Package org.simpleframework.xml.core
Interface Extractor<T extends java.lang.annotation.Annotation>
-
- All Known Implementing Classes:
ExtractorFactory.ElementExtractor
,ExtractorFactory.ElementListExtractor
,ExtractorFactory.ElementMapExtractor
interface Extractor<T extends java.lang.annotation.Annotation>
TheExtractor
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:
ExtractorFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T[]
getAnnotations()
This is used to acquire each annotation that forms part of the union group.Label
getLabel(T label)
This creates aLabel
object used to represent the annotation provided.java.lang.Class
getType(T label)
Each annotation can provide a class which is used to determine which label is used to serialize an object.
-
-
-
Method Detail
-
getAnnotations
T[] getAnnotations() throws java.lang.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 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:
java.lang.Exception
-
getType
java.lang.Class getType(T label) throws java.lang.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:
java.lang.Exception
-
getLabel
Label getLabel(T label) throws java.lang.Exception
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:
java.lang.Exception
-
-