Interface Extractor<T extends Annotation>

All Known Implementing Classes:
ExtractorFactory.ElementExtractor, ExtractorFactory.ElementListExtractor, ExtractorFactory.ElementMapExtractor

interface Extractor<T extends Annotation>
The Extractor interface is used to represent an object that can be used to extract constituent parts from a union. Using this allows a uniform interface to be used to interface with various different union annotations.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    T[]
    This is used to acquire each annotation that forms part of the union group.
    getLabel(T label)
    This creates a Label object used to represent the annotation provided.
    getType(T label)
    Each annotation can provide a class which is used to determine which label is used to serialize an object.
  • Method Details

    • getAnnotations

      T[] getAnnotations() throws Exception
      This is used to acquire each annotation that forms part of the union group. Extracting the annotations in this way allows the extractor to build a Label which can be used to represent the annotation. Each label can then provide a converter implementation to serialize objects.
      Returns:
      this returns each annotation within the union group
      Throws:
      Exception
    • getType

      Class getType(T label) throws Exception
      Each annotation can provide a class which is used to determine which label is used to serialize an object. This ensures that the correct label is selected whenever serialization occurs.
      Parameters:
      label - this is the annotation to extract the type for
      Returns:
      this returns the class associated with the annotation
      Throws:
      Exception
    • getLabel

      Label getLabel(T label) throws Exception
      This creates a Label object used to represent the annotation provided. Creating the label in this way ensures that each union has access to the serialization methods defined for each type an XML element name.
      Parameters:
      label - this is the annotation to create the label for
      Returns:
      this is the label created for the annotation
      Throws:
      Exception