private boolean hasProperConstructor(Class<? extends EntityTuplizer> tuplizerClass, Class[] constructorArgs) { return getProperConstructor( tuplizerClass, constructorArgs ) != null && ! ReflectHelper.isAbstractClass( tuplizerClass ); }
public PojoInstantiator(Class componentClass, ReflectionOptimizer.InstantiationOptimizer optimizer) { this.mappedClass = componentClass; this.isAbstract = ReflectHelper.isAbstractClass( mappedClass ); this.optimizer = optimizer; this.embeddedIdentifier = false; try { constructor = ReflectHelper.getDefaultConstructor(mappedClass); } catch ( PropertyNotFoundException pnfe ) { LOG.noDefaultConstructor(mappedClass.getName()); constructor = null; } }
public PojoInstantiator( Class mappedClass, ReflectionOptimizer.InstantiationOptimizer optimizer, boolean embeddedIdentifier) { this.mappedClass = mappedClass; this.optimizer = optimizer; this.embeddedIdentifier = embeddedIdentifier; this.isAbstract = ReflectHelper.isAbstractClass( mappedClass ); try { constructor = ReflectHelper.getDefaultConstructor(mappedClass); } catch ( PropertyNotFoundException pnfe ) { LOG.noDefaultConstructor( mappedClass.getName() ); constructor = null; } }
/** * Retrieve the default (no arg) constructor from the given class. * * @param clazz The class for which to retrieve the default ctor. * @return The default constructor. * @throws PropertyNotFoundException Indicates there was not publicly accessible, no-arg constructor (todo : why PropertyNotFoundException???) */ public static <T> Constructor<T> getDefaultConstructor(Class<T> clazz) throws PropertyNotFoundException { if ( isAbstractClass( clazz ) ) { return null; } try { Constructor<T> constructor = clazz.getDeclaredConstructor( NO_PARAM_SIGNATURE ); ensureAccessibility( constructor ); return constructor; } catch ( NoSuchMethodException nme ) { throw new PropertyNotFoundException( "Object class [" + clazz.getName() + "] must declare a default (no-argument) constructor" ); } }
protected Instantiator buildInstantiator(Component component) { if ( component.isEmbedded() && ReflectHelper.isAbstractClass( this.componentClass ) ) { return new ProxiedInstantiator( this.componentClass ); } if ( optimizer == null ) { return new PojoInstantiator( this.componentClass, null ); } else { return new PojoInstantiator( this.componentClass, optimizer.getInstantiationOptimizer() ); } }
ReflectHelper.isAbstractClass( persistentClass.getMappedClass() ); ReflectHelper.isAbstractClass( persistentClass.getMappedClass() ) ) { LOG.entityMappedAsNonAbstract(name);
public AbstractPojoInstantiator(Class mappedPojoClass) { this.mappedPojoClass = mappedPojoClass; this.isAbstract = ReflectHelper.isAbstractClass( mappedPojoClass ); }
private boolean hasProperConstructor(Class<? extends EntityTuplizer> tuplizerClass, Class[] constructorArgs) { return getProperConstructor( tuplizerClass, constructorArgs ) != null && ! ReflectHelper.isAbstractClass( tuplizerClass ); }
private boolean hasProperConstructor(Class<? extends EntityTuplizer> tuplizerClass, Class[] constructorArgs) { return getProperConstructor( tuplizerClass, constructorArgs ) != null && ! ReflectHelper.isAbstractClass( tuplizerClass ); }
/** * Retrieve the default (no arg) constructor from the given class. * * @param clazz The class for which to retrieve the default ctor. * @return The default constructor. * @throws PropertyNotFoundException Indicates there was not publicly accessible, no-arg constructor (todo : why PropertyNotFoundException???) */ public static <T> Constructor<T> getDefaultConstructor(Class<T> clazz) throws PropertyNotFoundException { if ( isAbstractClass( clazz ) ) { return null; } try { Constructor<T> constructor = clazz.getDeclaredConstructor( NO_PARAM_SIGNATURE ); ensureAccessibility( constructor ); return constructor; } catch ( NoSuchMethodException nme ) { throw new PropertyNotFoundException( "Object class [" + clazz.getName() + "] must declare a default (no-argument) constructor" ); } }
/** * Retrieve the default (no arg) constructor from the given class. * * @param clazz The class for which to retrieve the default ctor. * @return The default constructor. * @throws PropertyNotFoundException Indicates there was not publicly accessible, no-arg constructor (todo : why PropertyNotFoundException???) */ public static Constructor getDefaultConstructor(Class clazz) throws PropertyNotFoundException { if ( isAbstractClass( clazz ) ) { return null; } try { Constructor constructor = clazz.getDeclaredConstructor( NO_PARAM_SIGNATURE ); if ( !isPublic( clazz, constructor ) ) { constructor.setAccessible( true ); } return constructor; } catch ( NoSuchMethodException nme ) { throw new PropertyNotFoundException( "Object class [" + clazz.getName() + "] must declare a default (no-argument) constructor" ); } }
/** * Retrieve the default (no arg) constructor from the given class. * * @param clazz The class for which to retrieve the default ctor. * @return The default constructor. * @throws PropertyNotFoundException Indicates there was not publicly accessible, no-arg constructor (todo : why PropertyNotFoundException???) */ public static Constructor getDefaultConstructor(Class clazz) throws PropertyNotFoundException { if ( isAbstractClass( clazz ) ) { return null; } try { Constructor constructor = clazz.getDeclaredConstructor( NO_PARAM_SIGNATURE ); if ( !isPublic( clazz, constructor ) ) { constructor.setAccessible( true ); } return constructor; } catch ( NoSuchMethodException nme ) { throw new PropertyNotFoundException( "Object class [" + clazz.getName() + "] must declare a default (no-argument) constructor" ); } }
public PojoInstantiator(Component component, ReflectionOptimizer.InstantiationOptimizer optimizer) { this.mappedClass = component.getComponentClass(); this.isAbstract = ReflectHelper.isAbstractClass( mappedClass ); this.optimizer = optimizer; this.proxyInterface = null; this.embeddedIdentifier = false; try { constructor = ReflectHelper.getDefaultConstructor(mappedClass); } catch ( PropertyNotFoundException pnfe ) { LOG.noDefaultConstructor(mappedClass.getName()); constructor = null; } }
public PojoInstantiator(Component component, ReflectionOptimizer.InstantiationOptimizer optimizer) { this.mappedClass = component.getComponentClass(); this.isAbstract = ReflectHelper.isAbstractClass( mappedClass ); this.optimizer = optimizer; this.proxyInterface = null; this.embeddedIdentifier = false; try { constructor = ReflectHelper.getDefaultConstructor(mappedClass); } catch ( PropertyNotFoundException pnfe ) { LOG.noDefaultConstructor(mappedClass.getName()); constructor = null; } }
public PojoInstantiator(PersistentClass persistentClass, ReflectionOptimizer.InstantiationOptimizer optimizer) { this.mappedClass = persistentClass.getMappedClass(); this.isAbstract = ReflectHelper.isAbstractClass( mappedClass ); this.proxyInterface = persistentClass.getProxyInterface(); this.embeddedIdentifier = persistentClass.hasEmbeddedIdentifier(); this.optimizer = optimizer; try { constructor = ReflectHelper.getDefaultConstructor( mappedClass ); } catch ( PropertyNotFoundException pnfe ) { LOG.noDefaultConstructor(mappedClass.getName()); constructor = null; } }
public PojoInstantiator(PersistentClass persistentClass, ReflectionOptimizer.InstantiationOptimizer optimizer) { this.mappedClass = persistentClass.getMappedClass(); this.isAbstract = ReflectHelper.isAbstractClass( mappedClass ); this.proxyInterface = persistentClass.getProxyInterface(); this.embeddedIdentifier = persistentClass.hasEmbeddedIdentifier(); this.optimizer = optimizer; try { constructor = ReflectHelper.getDefaultConstructor( mappedClass ); } catch ( PropertyNotFoundException pnfe ) { LOG.noDefaultConstructor(mappedClass.getName()); constructor = null; } }
protected Instantiator buildInstantiator(Component component) { if ( component.isEmbedded() && ReflectHelper.isAbstractClass( component.getComponentClass() ) ) { return new ProxiedInstantiator( component ); } if ( optimizer == null ) { return new PojoInstantiator( component, null ); } else { return new PojoInstantiator( component, optimizer.getInstantiationOptimizer() ); } }
protected Instantiator buildInstantiator(Component component) { if ( component.isEmbedded() && ReflectHelper.isAbstractClass( component.getComponentClass() ) ) { return new ProxiedInstantiator( component ); } if ( optimizer == null ) { return new PojoInstantiator( component, null ); } else { return new PojoInstantiator( component, optimizer.getInstantiationOptimizer() ); } }
public PojoInstantiator(EntityBinding entityBinding, ReflectionOptimizer.InstantiationOptimizer optimizer) { this.mappedClass = entityBinding.getEntity().getClassReference(); this.isAbstract = ReflectHelper.isAbstractClass( mappedClass ); this.proxyInterface = entityBinding.getProxyInterfaceType().getValue(); this.embeddedIdentifier = entityBinding.getHierarchyDetails().getEntityIdentifier().isEmbedded(); this.optimizer = optimizer; try { constructor = ReflectHelper.getDefaultConstructor( mappedClass ); } catch ( PropertyNotFoundException pnfe ) { LOG.noDefaultConstructor(mappedClass.getName()); constructor = null; } }
public PojoInstantiator(EntityBinding entityBinding, ReflectionOptimizer.InstantiationOptimizer optimizer) { this.mappedClass = entityBinding.getEntity().getClassReference(); this.isAbstract = ReflectHelper.isAbstractClass( mappedClass ); this.proxyInterface = entityBinding.getProxyInterfaceType().getValue(); this.embeddedIdentifier = entityBinding.getHierarchyDetails().getEntityIdentifier().isEmbedded(); this.optimizer = optimizer; try { constructor = ReflectHelper.getDefaultConstructor( mappedClass ); } catch ( PropertyNotFoundException pnfe ) { LOG.noDefaultConstructor(mappedClass.getName()); constructor = null; } }