Package com.codiform.moo.property

Examples of com.codiform.moo.property.Property


  private Set<Property> getPropertiesForClass( Class<?> clazz ) {
    Map<String, Property> properties = new HashMap<String, Property>();
    Access access = clazz.getAnnotation( Access.class );
    AccessMode mode = access == null ? configuration.getDefaultAccessMode() : access.value();
    for ( Field item : clazz.getDeclaredFields() ) {
      Property property = PropertyFactory.createProperty( item, mode );
      if ( property != null ) {
        properties.put( property.getName(), property );
      }
    }
    for ( Method item : clazz.getDeclaredMethods() ) {
      Property property = PropertyFactory.createProperty( item, mode );
      if ( property != null ) {
        if ( properties.containsKey( property.getName() ) ) {
          Property current = properties.get( property.getName() );
          if ( current.isExplicit() && property.isExplicit() ) {
            throw new InvalidPropertyException(
                property.getName(),
                property.getDeclaringClass(),
                "Property %s (in %s) is explicitly defined with @Property as both field and method properties; Moo expects no more than one annotation per property name per class." );
          } else if ( !current.isExplicit() && property.isExplicit() ) {
            properties.put( property.getName(), property );
          }
        } else {
          properties.put( property.getName(), property );
        }
View Full Code Here

TOP

Related Classes of com.codiform.moo.property.Property

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.