Java 类org.hibernate.property.ChainedPropertyAccessor 实例源码

项目:lams    文件:AliasToBeanResultTransformer.java   
private void initialize(String[] aliases) {
    PropertyAccessor propertyAccessor = new ChainedPropertyAccessor(
            new PropertyAccessor[] {
                    PropertyAccessorFactory.getPropertyAccessor( resultClass, null ),
                    PropertyAccessorFactory.getPropertyAccessor( "field" )
            }
    );
    this.aliases = new String[ aliases.length ];
    setters = new Setter[ aliases.length ];
    for ( int i = 0; i < aliases.length; i++ ) {
        String alias = aliases[ i ];
        if ( alias != null ) {
            this.aliases[ i ] = alias;
            setters[ i ] = propertyAccessor.getSetter( resultClass, alias );
        }
    }
    isInitialized = true;
}
项目:karaku    文件:KarakuAliasToBeanTransformer.java   
private void initialize(String[] newAlias) {

        PropertyAccessor propertyAccessor = new ChainedPropertyAccessor(
                new PropertyAccessor[] {
                        PropertyAccessorFactory.getPropertyAccessor(
                                resultClass, null),
                        PropertyAccessorFactory.getPropertyAccessor("field") });
        this.aliases = new String[newAlias.length];
        setters = new Setter[newAlias.length];
        for (int i = 0; i < newAlias.length; i++) {
            String alias = newAlias[i];
            if (alias != null) {
                this.aliases[i] = alias;
                // Diferencia con AliasToBeanResultTransformer

                if (alias.indexOf('.') > 0) {
                    // found nested
                    setters[i] = new NestedSetter(resultClass, alias);
                } else {

                    // -------------------------------------------
                    setters[i] = propertyAccessor.getSetter(resultClass, alias);
                    // Diferencia con AliasToBeanResultTransformer
                }
                // -------------------------------------------
            }
        }
        isInitialized = true;
    }
项目:TechnologyReadinessTool    文件:IgnoringCaseAliasToBeanResultTransformer.java   
@SuppressWarnings("rawtypes")
public IgnoringCaseAliasToBeanResultTransformer(final Class resultClass) {
    if (resultClass == null) {
        throw new IllegalArgumentException("resultClass cannot be null");
    }
    this.resultClass = resultClass;
    propertyAccessor = new ChainedPropertyAccessor(new PropertyAccessor[] {
            PropertyAccessorFactory.getPropertyAccessor(resultClass, null),
            PropertyAccessorFactory.getPropertyAccessor("field") });
    fields = this.resultClass.getDeclaredFields();
}
项目:cacheonix-core    文件:AliasToBeanResultTransformer.java   
public AliasToBeanResultTransformer(Class resultClass) {
    if(resultClass==null) throw new IllegalArgumentException("resultClass cannot be null");
    this.resultClass = resultClass;
    propertyAccessor = new ChainedPropertyAccessor(new PropertyAccessor[] { PropertyAccessorFactory.getPropertyAccessor(resultClass,null), PropertyAccessorFactory.getPropertyAccessor("field")});      
}