Class GenericObjectFactory


  • public final class GenericObjectFactory
    extends Object
    The generic object factory contains all methods necessary to collect the property values needed to produce a fully instantiated object.
    • Constructor Detail

      • GenericObjectFactory

        public GenericObjectFactory​(Class c,
                                    String registerName,
                                    ConstructorDefinition[] constructors,
                                    PropertyDefinition[] propertyDefinitions,
                                    LookupDefinition[] lookupDefinitions,
                                    AttributeDefinition[] attributeDefinitions,
                                    String[] orderedPropertyNames)
                             throws ObjectDescriptionException
        Creates a new generic object factory.
        Parameters:
        c - the class.
        registerName - the (optional) name under which to register the class for any later lookup.
        constructors - the constructor definitions.
        propertyDefinitions - the property definitions.
        lookupDefinitions - the lookup definitions.
        attributeDefinitions - the attribute definitions.
        orderedPropertyNames - the ordered property names.
        Throws:
        ObjectDescriptionException - if there is a problem.
    • Method Detail

      • getInstance

        public GenericObjectFactory getInstance()
        Returns a copy of this instance.
        Returns:
        a copy of this instance.
      • getRegisterName

        public String getRegisterName()
        Returns the register name.
        Returns:
        the register name.
      • isPropertyDefinition

        public boolean isPropertyDefinition​(String propertyName)
        Returns true if there is a property definition for the specified property name.
        Parameters:
        propertyName - the property name.
        Returns:
        A boolean.
      • getPropertyDefinitionByPropertyName

        public PropertyDefinition getPropertyDefinitionByPropertyName​(String propertyName)
                                                               throws ObjectDescriptionException
        Returns the property definition for the specified property name.
        Parameters:
        propertyName - the property name.
        Returns:
        the property definition.
        Throws:
        ObjectDescriptionException - if there is no such property for this object.
      • getConstructorDefinitions

        public ConstructorDefinition[] getConstructorDefinitions()
        Returns the constructor definitions.
        Returns:
        the constructor definitions.
      • getAttributeDefinitions

        public AttributeDefinition[] getAttributeDefinitions()
        Returns the attribute definitions.
        Returns:
        the attribute definitions.
      • getPropertyDefinitions

        public PropertyDefinition[] getPropertyDefinitions()
        Returns the property definitions.
        Returns:
        the property definitions.
      • getOrderedPropertyNames

        public String[] getOrderedPropertyNames()
        Returns the property names.
        Returns:
        the property names.
      • getLookupDefinitions

        public LookupDefinition[] getLookupDefinitions()
        Returns the lookup definitions.
        Returns:
        the lookup definitions.
      • getProperty

        public Object getProperty​(String name)
        Returns the value of the specified property.
        Parameters:
        name - the property name.
        Returns:
        the property value.
      • getBaseClass

        public Class getBaseClass()
        Returns the base class.
        Returns:
        the base class.