| | |
| | | import de.hsadmin.core.model.AuthenticationException; |
| | | import de.hsadmin.core.model.HSAdminException; |
| | | import de.hsadmin.core.model.ReadWriteAccess; |
| | | import de.hsadmin.core.model.SelectableValue; |
| | | import de.hsadmin.core.model.Transaction; |
| | | |
| | | public class ModulePropertiesRemote implements IRemote { |
| | |
| | | for (Field f: entityClass.getDeclaredFields()) { |
| | | HashMap<String, Object> propertyProperties = new HashMap<String, Object>(); |
| | | AnnFieldIO fieldIO = f.getAnnotation(AnnFieldIO.class); |
| | | if (fieldIO != null){ |
| | | if (fieldIO != null) { |
| | | String fieldName = f.getName(); |
| | | propertyProperties.put("property", fieldName); |
| | | String regExp = fieldIO.validation(); |
| | |
| | | ReadWriteAccess rw = fieldIO.rw(); |
| | | propertyProperties.put("rw", rw.name()); |
| | | String[] referredProps = fieldIO.referredProps(); |
| | | propertyProperties.put("referredProps", referredProps); |
| | | // Class<?> declaringClass = f.getDeclaringClass(); |
| | | propertyProperties.put("referredProps", referredProps); |
| | | // Class<?> declaringClass = f.getDeclaringClass(); |
| | | // declaringClass = f.getDeclaringClass(); |
| | | for(String s : referredProps){ |
| | | String fullPropertyName = fieldName+"."+s; |
| | | for(String s : referredProps) { |
| | | String fullPropertyName = fieldName+"."+s; |
| | | propertiesList.add(createReferredPropertyInfo(fullPropertyName, f, s)); |
| | | } |
| | | AddCommonPropertyInfo(propertyProperties, f); |
| | | ArrayList<Map<String,Object>> selectableValueslist = new ArrayList<Map<String,Object>>(); |
| | | List<SelectableValue> selectableValues = fieldIO.selectableValues().newInstance().get(); |
| | | propertyProperties.put("selectableValues", selectableValueslist); |
| | | for( SelectableValue s : selectableValues) { |
| | | String SelectableValueName = s.getName(); |
| | | Object SelectableValues = s.getValues(); |
| | | Map<String, Object> m = new HashMap<String, Object>(); |
| | | m.put(SelectableValueName, SelectableValues); |
| | | selectableValueslist.add(m); |
| | | } |
| | | addCommonPropertyInfo(propertyProperties, f); |
| | | propertiesList.add(propertyProperties); |
| | | } |
| | | } |
| | |
| | | // trace = trace + " TF=" + field.getName(); |
| | | remainingPart = remainingPart.substring(indexOfDot + 1); |
| | | } |
| | | AddCommonPropertyInfo(result, field); |
| | | addCommonPropertyInfo(result, field); |
| | | return result; |
| | | } |
| | | |
| | | private void AddCommonPropertyInfo(Map<String, Object> propertyInfo, Field sourceField) { |
| | | private void addCommonPropertyInfo(Map<String, Object> propertyInfo, Field sourceField) { |
| | | propertyInfo.put("type", sourceField.getType().getName()); |
| | | } |
| | | |