Class ConstructorScanner


  • class ConstructorScanner
    extends java.lang.Object
    The ConstructorScanner object is used to scan all all constructors that have XML annotations for their parameters. parameters. Each constructor scanned is converted in to a Initializer object. In order to ensure consistency amongst the annotated parameters each named parameter must have the exact same type and annotation attributes across the constructors. This ensures a consistent XML representation.
    See Also:
    Scanner
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Signature primary
      This represents the default no argument constructor.
      private ParameterMap registry
      This is used to acquire a parameter by the parameter name.
      private java.util.List<Signature> signatures
      This is a list of all the signatures represented by the type.
      private Support support
      This object contains various support functions for the class.
    • Constructor Summary

      Constructors 
      Constructor Description
      ConstructorScanner​(Detail detail, Support support)
      Constructor for the ConstructorScanner object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ParameterMap getParameters()
      This returns a map of all parameters that exist.
      Signature getSignature()
      This is used to acquire the default signature for the class.
      java.util.List<Signature> getSignatures()
      This returns the signatures for the type.
      private void scan​(java.lang.reflect.Constructor factory)
      This is used to scan the parameters within a constructor to determine the signature of the constructor.
      private void scan​(Detail detail)
      This is used to scan the specified class for constructors that can be used to instantiate the class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • signatures

        private java.util.List<Signature> signatures
        This is a list of all the signatures represented by the type.
      • registry

        private ParameterMap registry
        This is used to acquire a parameter by the parameter name.
      • primary

        private Signature primary
        This represents the default no argument constructor.
      • support

        private Support support
        This object contains various support functions for the class.
    • Constructor Detail

      • ConstructorScanner

        public ConstructorScanner​(Detail detail,
                                  Support support)
                           throws java.lang.Exception
        Constructor for the ConstructorScanner object. This is used to scan the specified detail for constructors that can be used to instantiate the class. Only constructors that have all parameters annotated will be considered.
        Parameters:
        detail - this contains the details for the class scanned
        support - this contains various support functions
        Throws:
        java.lang.Exception
    • Method Detail

      • getSignature

        public Signature getSignature()
        This is used to acquire the default signature for the class. The default signature is the signature for the no argument constructor for the type. If there is no default constructor for the type then this will return null.
        Returns:
        this returns the default signature if it exists
      • getSignatures

        public java.util.List<Signature> getSignatures()
        This returns the signatures for the type. All constructors are represented as a signature and returned. More signatures than constructors will be returned if a constructor is annotated with a union annotation.
        Returns:
        this returns the list of signatures for the type
      • getParameters

        public ParameterMap getParameters()
        This returns a map of all parameters that exist. This is used to validate all the parameters against the field and method annotations that exist within the class.
        Returns:
        this returns a map of all parameters within the type
      • scan

        private void scan​(Detail detail)
                   throws java.lang.Exception
        This is used to scan the specified class for constructors that can be used to instantiate the class. Only constructors that have all parameters annotated will be considered.
        Parameters:
        detail - this is the class detail that is to be scanned
        Throws:
        java.lang.Exception
      • scan

        private void scan​(java.lang.reflect.Constructor factory)
                   throws java.lang.Exception
        This is used to scan the parameters within a constructor to determine the signature of the constructor. If the constructor contains a union annotation multiple signatures will be used.
        Parameters:
        factory - the constructor to scan for parameters
        Throws:
        java.lang.Exception