Package org.simpleframework.xml.core
Class ExtractorFactory.ElementListExtractor
- java.lang.Object
-
- org.simpleframework.xml.core.ExtractorFactory.ElementListExtractor
-
- All Implemented Interfaces:
Extractor<ElementList>
- Enclosing class:
- ExtractorFactory
private static class ExtractorFactory.ElementListExtractor extends java.lang.Object implements Extractor<ElementList>
TheElementListExtractor
object is used extract the constituent parts of the provided union annotation. This can also be used to create a Label object for each of the declared annotation for dynamic serialization.
-
-
Field Summary
Fields Modifier and Type Field Description private Contact
contact
This is the contact that has been annotated as a union.private Format
format
This is the format used to style the elements for this.private ElementListUnion
union
This is the union annotation to extract the labels for.
-
Constructor Summary
Constructors Constructor Description ElementListExtractor(Contact contact, ElementListUnion union, Format format)
Constructor for theElementListExtractor
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ElementList[]
getAnnotations()
This is used to acquire each annotation that forms part of the union group.Label
getLabel(ElementList element)
This creates aLabel
object used to represent the annotation provided.java.lang.Class
getType(ElementList element)
Each annotation can provide a class which is used to determine which label is used to serialize an object.
-
-
-
Field Detail
-
contact
private final Contact contact
This is the contact that has been annotated as a union.
-
union
private final ElementListUnion union
This is the union annotation to extract the labels for.
-
format
private final Format format
This is the format used to style the elements for this.
-
-
Constructor Detail
-
ElementListExtractor
public ElementListExtractor(Contact contact, ElementListUnion union, Format format) throws java.lang.Exception
Constructor for theElementListExtractor
object. This is used to create an extractor that can be used to extract the various labels used to serialize and deserialize objects.- Parameters:
contact
- this is the contact annotated as a unionunion
- this is the union annotation to extract fromformat
- this is the format used to style the elements- Throws:
java.lang.Exception
-
-
Method Detail
-
getAnnotations
public ElementList[] 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.- Specified by:
getAnnotations
in interfaceExtractor<ElementList>
- Returns:
- this returns each annotation within the union group
-
getLabel
public Label getLabel(ElementList element)
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.- Specified by:
getLabel
in interfaceExtractor<ElementList>
- Parameters:
element
- this is the annotation to create the label for- Returns:
- this is the label created for the annotation
-
getType
public java.lang.Class getType(ElementList element)
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.- Specified by:
getType
in interfaceExtractor<ElementList>
- Parameters:
element
- this is the annotation to extract the type for- Returns:
- this returns the class associated with the annotation
-
-