Class ConstructorScanner

java.lang.Object
org.simpleframework.xml.core.ConstructorScanner

class ConstructorScanner extends 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:
  • Field Details

    • signatures

      private 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 Details

    • ConstructorScanner

      public ConstructorScanner(Detail detail, Support support) throws 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:
      Exception
  • Method Details

    • 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 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 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:
      Exception
    • scan

      private void scan(Constructor factory) throws 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:
      Exception