Class ExtractorFactory

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

class ExtractorFactory extends Object
The ExtractorFactory is used to create an extractor object that can be used to build a label for each annotation in the union group. In order to build an extractor the factory requires the Contact and the union annotation. Each extractor created by this factory can be used to extract the constituent parts of each label defined in the union.
See Also:
  • Field Details

    • label

      private final Annotation label
      This is the union annotation this creates extractors for.
    • contact

      private final Contact contact
      This is the contact that has been annotated as a union.
    • format

      private final Format format
      The format used for each of the extractors instantiated.
  • Constructor Details

    • ExtractorFactory

      public ExtractorFactory(Contact contact, Annotation label, Format format)
      Constructor for the ExtractorFactory object. This requires the contact that was annotated as a union and the actual union annotation, which is used to build individual labels based on the declarations.
      Parameters:
      contact - this is the field or method annotated
      label - this is the union annotation to extract from
      format - this is the format used by the extractors
  • Method Details

    • getInstance

      public Extractor getInstance() throws Exception
      This is used to instantiate an Extractor based on the union annotation provided. Each extractor provides a uniform interface to the constituent parts of the union.
      Returns:
      this returns an extractor for the union
      Throws:
      Exception
    • getInstance

      private Object getInstance(Annotation label) throws Exception
      This is used to instantiate an Extractor based on the union annotation provided. Each extractor provides a uniform interface to the constituent parts of the union.
      Parameters:
      label - this is the union annotation to be used
      Returns:
      this returns an extractor for the union
      Throws:
      Exception
    • getBuilder

      private ExtractorFactory.ExtractorBuilder getBuilder(Annotation label) throws Exception
      This returns a builder used to instantiate an extractor based on a particular union annotation. If the annotation provided does not represent a valid union an exception is thrown.
      Parameters:
      label - this is the union annotation to build for
      Returns:
      this returns a builder used to create an extractor
      Throws:
      Exception