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; } } } }
if ( !property.isWritable() ) { attributes.put( NO_SETTER, TRUE ); if ( !property.isReadable() ) { attributes.put( NO_GETTER, TRUE ); String genericType = property.getGenericType();
private void getReversePrimaryKey(Property property, Map<String, String> attributes) { // Reverse primary key for (Property reverseProperty : getProperties(property.getType()).values()) { if (reverseProperty.isAnnotationPresent(Id.class)) { attributes.put(REVERSE_PRIMARY_KEY, reverseProperty.getName()); break; } } }
private void getCollectionReversePrimaryKey(Property property, Map<String, String> attributes) { // Reverse primary key for (Property reverseProperty : getProperties(property.getGenericType()).values()) { if (reverseProperty.isAnnotationPresent(Id.class)) { attributes.put(REVERSE_PRIMARY_KEY, reverseProperty.getName()); break; } } }
String actualType = property.getType(); Class<?> actualClass = ClassUtils.niceForName( actualType ); if ( property.isReadable() && ( actualClass == null || !Modifier.isFinal( actualClass.getModifiers() ) ) ) { Object propertyValue = null; propertyValue = property.read( toInspect ); } catch ( Exception e ) { return inspectEntity( property.getType(), actualType );
Property property = getProperties( traverseDeclaredType ).get( name ); if ( property == null || !property.isReadable() ) { return new ValueAndDeclaredType( null, null ); traverseDeclaredType = property.getType();
@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; } }
if (property.isAnnotationPresent(OneToOne.class)) if (property.isAnnotationPresent(OneToOne.class)) if (property.isAnnotationPresent(Embedded.class) || isPropertyTypeEmbeddedable(property.getType())) if (property.isAnnotationPresent(ManyToOne.class)) if (property.isAnnotationPresent(OneToMany.class) || property.isAnnotationPresent(ManyToMany.class)) if (property.isAnnotationPresent(OneToMany.class)) if (property.isAnnotationPresent(Id.class)) if (property.isAnnotationPresent(GeneratedValue.class)) if (property.isAnnotationPresent(Column.class)) Column annotation = property.getAnnotation(Column.class); if (annotation.length() >= TEXT_AREA_GENERATION_LENGTH)
if (property.isAnnotationPresent(OneToOne.class)) if (property.isAnnotationPresent(OneToOne.class)) if(property.isAnnotationPresent(Embedded.class) || isPropertyTypeEmbeddedable(property.getType())) if (property.isAnnotationPresent(ManyToOne.class)) if (property.isAnnotationPresent(OneToMany.class) || property.isAnnotationPresent(ManyToMany.class)) if (property.isAnnotationPresent(OneToMany.class)) if (property.isAnnotationPresent(Id.class)) if (property.isAnnotationPresent(GeneratedValue.class))
@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; } }
String actualType = actualProperty.getType();
element.setAttribute( NAME, property.getName() );
collection = (Collection<?>) property.read( toInspect );
String actualType = property.getType(); Class<?> actualClass = ClassUtils.niceForName( actualType ); if ( property.isReadable() && ( actualClass == null || !Modifier.isFinal( actualClass.getModifiers() ) ) ) { Object propertyValue = null; propertyValue = property.read( toInspect ); } catch ( Exception e ) { return inspectEntity( property.getType(), actualType );
private void getReversePrimaryKey(Property property, Map<String, String> attributes) { // Reverse primary key for (Property reverseProperty : getProperties(property.getType()).values()) { if (reverseProperty.isAnnotationPresent(Id.class)) { attributes.put(REVERSE_PRIMARY_KEY, reverseProperty.getName()); break; } } }
private void getCollectionReversePrimaryKey(Property property, Map<String, String> attributes) { // Reverse primary key for (Property reverseProperty : getProperties(property.getGenericType()).values()) { if (reverseProperty.isAnnotationPresent(Id.class)) { attributes.put(REVERSE_PRIMARY_KEY, reverseProperty.getName()); break; } } }
Property property = getProperties( traverseDeclaredType ).get( name ); if ( property == null || !property.isReadable() ) { return new ValueAndDeclaredType( null, null ); traverseDeclaredType = property.getType();
if ( property.isAnnotationPresent( UiRequired.class ) ) { attributes.put( REQUIRED, TRUE ); UiLookup lookup = property.getAnnotation( UiLookup.class ); if ( property.isAnnotationPresent( UiMasked.class ) ) { attributes.put( MASKED, TRUE ); if ( property.isAnnotationPresent( UiLarge.class ) ) { attributes.put( LARGE, TRUE ); if ( property.isAnnotationPresent( UiWide.class ) ) { attributes.put( WIDE, TRUE ); UiDontExpand dontExpand = property.getAnnotation( UiDontExpand.class );