@Override protected Map<String, String> inspectProperty( Property property ) throws Exception { Map<String, String> attributes = CollectionUtils.newHashMap(); // UiJspLookup UiJspLookup jspLookup = property.getAnnotation( UiJspLookup.class ); if ( jspLookup != null ) { attributes.put( JSP_LOOKUP, jspLookup.value() ); } return attributes; } }
@Override protected Map<String, String> inspectProperty( Property property ) throws Exception { Map<String, String> attributes = CollectionUtils.newHashMap(); // Hidden JsonIgnore jsonIgnore = property.getAnnotation( JsonIgnore.class ); if ( jsonIgnore != null && jsonIgnore.value() ) { attributes.put( HIDDEN, TRUE ); } return attributes; } }
@Override protected Map<String, String> inspectProperty( Property property ) throws Exception { Map<String, String> attributes = CollectionUtils.newHashMap(); // Hidden if ( property.isAnnotationPresent( XmlTransient.class ) ) { attributes.put( HIDDEN, TRUE ); } // Required XmlElement xmlElement = property.getAnnotation( XmlElement.class ); if ( xmlElement != null ) { // XmlElement overrides XmlTransient attributes.put( HIDDEN, FALSE ); if ( xmlElement.required() ) { attributes.put( REQUIRED, TRUE ); } } return attributes; } }
@Override protected Map<String, String> inspectProperty( Property property ) throws Exception { Map<String, String> attributes = CollectionUtils.newHashMap(); // SpringLookup UiSpringLookup springLookup = property.getAnnotation( UiSpringLookup.class ); if ( springLookup != null ) { attributes.put( SPRING_LOOKUP, springLookup.value() ); String itemValue = springLookup.itemValue(); if ( !"".equals( itemValue ) ) { attributes.put( SPRING_LOOKUP_ITEM_VALUE, itemValue ); } String itemLabel = springLookup.itemLabel(); if ( !"".equals( itemLabel ) ) { attributes.put( SPRING_LOOKUP_ITEM_LABEL, itemLabel ); } } return attributes; } }
@Override protected Map<String, String> inspectProperty( Property property ) throws Exception { Map<String, String> attributes = CollectionUtils.newHashMap(); // ExpressionLookup UiStrutsLookup expressionLookup = property.getAnnotation( UiStrutsLookup.class ); if ( expressionLookup != null ) { attributes.put( STRUTS_LOOKUP_NAME, expressionLookup.name() ); attributes.put( STRUTS_LOOKUP_PROPERTY, expressionLookup.property() ); String labelName = expressionLookup.labelName(); if ( !"".equals( labelName ) ) { attributes.put( STRUTS_LOOKUP_LABEL_NAME, labelName ); } String labelProperty = expressionLookup.labelProperty(); if ( !"".equals( labelProperty ) ) { attributes.put( STRUTS_LOOKUP_LABEL_PROPERTY, labelProperty ); } } return attributes; } }
Digits digits = property.getAnnotation( Digits.class ); Min min = property.getAnnotation( Min.class ); Max max = property.getAnnotation( Max.class ); Size size = property.getAnnotation( Size.class ); Pattern pattern = property.getAnnotation( Pattern.class );
private void getOneToManyBidirectionalProperties(Property property, Map<String, String> attributes) { String owningProperty = property.getAnnotation(OneToMany.class).mappedBy(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a OneToMany * field as the inverse side of the association. */ if (!owningProperty.isEmpty()) { attributes.put(INVERSE_FIELD, property.getName()); for (Property reverseProperty : getProperties(property.getGenericType()).values()) { String reversePropertyName = reverseProperty.getName(); String reversePropertyType = reverseProperty.getType(); if (reverseProperty.isAnnotationPresent(ManyToOne.class) && reversePropertyName.equals(owningProperty) && reversePropertyType.equals(getTypeUnderInspection())) { attributes.put(OWNING_FIELD, reversePropertyName); break; } } } }
private void getOneToManyBidirectionalProperties(Property property, Map<String, String> attributes) { String owningProperty = property.getAnnotation(OneToMany.class).mappedBy(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a OneToMany * field as the inverse side of the association. */ if (!owningProperty.isEmpty()) { attributes.put(INVERSE_FIELD, property.getName()); for (Property reverseProperty : getProperties(property.getGenericType()).values()) { String reversePropertyName = reverseProperty.getName(); String reversePropertyType = reverseProperty.getType(); if (reverseProperty.isAnnotationPresent(ManyToOne.class) && reversePropertyName.equals(owningProperty) && reversePropertyType.equals(getTypeUnderInspection())) { attributes.put(OWNING_FIELD, reversePropertyName); break; } } } }
private void getOneToManyBidirectionalProperties(Property property, Map<String, String> attributes) { String owningProperty = property.getAnnotation(OneToMany.class).mappedBy(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a OneToMany * field as the inverse side of the association. */ if (!owningProperty.isEmpty()) { attributes.put(INVERSE_FIELD, property.getName()); for (Property reverseProperty : getProperties(property.getGenericType()).values()) { String reversePropertyName = reverseProperty.getName(); String reversePropertyType = reverseProperty.getType(); if (reverseProperty.isAnnotationPresent(ManyToOne.class) && reversePropertyName.equals(owningProperty) && reversePropertyType.equals(getTypeUnderInspection())) { attributes.put(OWNING_FIELD, reversePropertyName); break; } } } }
private void getOneToManyBidirectionalProperties(Property property, Map<String, String> attributes) { String owningProperty = property.getAnnotation(OneToMany.class).mappedBy(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a OneToMany * field as the inverse side of the association. */ if (!owningProperty.isEmpty()) { attributes.put(INVERSE_FIELD, property.getName()); for (Property reverseProperty : getProperties(property.getGenericType()).values()) { String reversePropertyName = reverseProperty.getName(); String reversePropertyType = reverseProperty.getType(); if (reverseProperty.isAnnotationPresent(ManyToOne.class) && reversePropertyName.equals(owningProperty) && reversePropertyType.equals(getTypeUnderInspection())) { attributes.put(OWNING_FIELD, reversePropertyName); break; } } } }
private void getManyToOneBidirectionalProperties(Property property, Map<String, String> attributes) { String propertyName = property.getName(); // The ManyToOne side is always the owning side attributes.put(OWNING_FIELD, propertyName); for (Property reverseProperty : getProperties(property.getType()).values()) { if (reverseProperty.isAnnotationPresent(OneToMany.class)) { String mappedPropertyName = reverseProperty.getAnnotation(OneToMany.class).mappedBy(); String reversePropertyType = reverseProperty.getGenericType(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a * OneToMany field as the inverse side of the association. */ if (reversePropertyType.equals(getTypeUnderInspection()) && mappedPropertyName.equals(propertyName)) { attributes.put(INVERSE_FIELD, reverseProperty.getName()); break; } } } }
private void getManyToOneBidirectionalProperties(Property property, Map<String, String> attributes) { String propertyName = property.getName(); // The ManyToOne side is always the owning side attributes.put(OWNING_FIELD, propertyName); for (Property reverseProperty : getProperties(property.getType()).values()) { if (reverseProperty.isAnnotationPresent(OneToMany.class)) { String mappedPropertyName = reverseProperty.getAnnotation(OneToMany.class).mappedBy(); String reversePropertyType = reverseProperty.getGenericType(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a * OneToMany field as the inverse side of the association. */ if (reversePropertyType.equals(getTypeUnderInspection()) && mappedPropertyName.equals(propertyName)) { attributes.put(INVERSE_FIELD, reverseProperty.getName()); break; } } } }
private void getManyToOneBidirectionalProperties(Property property, Map<String, String> attributes) { String propertyName = property.getName(); // The ManyToOne side is always the owning side attributes.put(OWNING_FIELD, propertyName); for (Property reverseProperty : getProperties(property.getType()).values()) { if (reverseProperty.isAnnotationPresent(OneToMany.class)) { String mappedPropertyName = reverseProperty.getAnnotation(OneToMany.class).mappedBy(); String reversePropertyType = reverseProperty.getGenericType(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a * OneToMany field as the inverse side of the association. */ if (reversePropertyType.equals(getTypeUnderInspection()) && mappedPropertyName.equals(propertyName)) { attributes.put(INVERSE_FIELD, reverseProperty.getName()); break; } } } }
UiLookup lookup = property.getAnnotation( UiLookup.class ); UiDontExpand dontExpand = property.getAnnotation( UiDontExpand.class );
UiLookup lookup = property.getAnnotation( UiLookup.class ); UiDontExpand dontExpand = property.getAnnotation( UiDontExpand.class );
private void getManyToOneBidirectionalProperties(Property property, Map<String, String> attributes) { String propertyName = property.getName(); // The ManyToOne side is always the owning side attributes.put(OWNING_FIELD, propertyName); for (Property reverseProperty : getProperties(property.getType()).values()) { if (reverseProperty.isAnnotationPresent(OneToMany.class)) { String mappedPropertyName = reverseProperty.getAnnotation(OneToMany.class).mappedBy(); String reversePropertyType = reverseProperty.getGenericType(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a * OneToMany field as the inverse side of the association. */ if (reversePropertyType.equals(getTypeUnderInspection()) && mappedPropertyName.equals(propertyName)) { attributes.put(INVERSE_FIELD, reverseProperty.getName()); break; } } } }
private void getOneToOneBidirectionalProperties(Property property, Map<String, String> attributes) String owningProperty = property.getAnnotation(OneToOne.class).mappedBy(); String propertyName = property.getName(); String reversePropertyType = reverseProperty.getType(); if (reverseProperty.isAnnotationPresent(OneToOne.class) && !reverseProperty.getAnnotation(OneToOne.class).mappedBy().isEmpty()) owningProperty = reverseProperty.getAnnotation(OneToOne.class).mappedBy(); if (propertyName.equals(owningProperty) && reversePropertyType.equals(getTypeUnderInspection()))
private void getOneToOneBidirectionalProperties(Property property, Map<String, String> attributes) String owningProperty = property.getAnnotation(OneToOne.class).mappedBy(); String propertyName = property.getName(); String reversePropertyType = reverseProperty.getType(); if (reverseProperty.isAnnotationPresent(OneToOne.class) && !reverseProperty.getAnnotation(OneToOne.class).mappedBy().isEmpty()) owningProperty = reverseProperty.getAnnotation(OneToOne.class).mappedBy(); if (propertyName.equals(owningProperty) && reversePropertyType.equals(getTypeUnderInspection()))
private void getOneToOneBidirectionalProperties(Property property, Map<String, String> attributes) String owningProperty = property.getAnnotation(OneToOne.class).mappedBy(); String propertyName = property.getName(); String reversePropertyType = reverseProperty.getType(); if (reverseProperty.isAnnotationPresent(OneToOne.class) && !reverseProperty.getAnnotation(OneToOne.class).mappedBy().isEmpty()) owningProperty = reverseProperty.getAnnotation(OneToOne.class).mappedBy(); if (propertyName.equals(owningProperty) && reversePropertyType.equals(getTypeUnderInspection()))
private void getOneToOneBidirectionalProperties(Property property, Map<String, String> attributes) String owningProperty = property.getAnnotation(OneToOne.class).mappedBy(); String propertyName = property.getName(); String reversePropertyType = reverseProperty.getType(); if (reverseProperty.isAnnotationPresent(OneToOne.class) && !reverseProperty.getAnnotation(OneToOne.class).mappedBy().isEmpty()) owningProperty = reverseProperty.getAnnotation(OneToOne.class).mappedBy(); if (propertyName.equals(owningProperty) && reversePropertyType.equals(getTypeUnderInspection()))