Package org.simpleframework.xml.core
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 TypeMethodDescriptionT[]
This is used to acquire each annotation that forms part of the union group.This creates aLabel
object used to represent the annotation provided.Each annotation can provide a class which is used to determine which label is used to serialize an object.
-
Method Details
-
getAnnotations
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 aLabel
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
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
This creates aLabel
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
-