Package org.simpleframework.xml.core
Class ExtractorFactory
- java.lang.Object
-
- org.simpleframework.xml.core.ExtractorFactory
-
class ExtractorFactory extends java.lang.ObjectTheExtractorFactoryis 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 theContactand 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:
Extractor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classExtractorFactory.ElementExtractorTheElementExtractorobject is used extract the constituent parts of the provided union annotation.private static classExtractorFactory.ElementListExtractorTheElementListExtractorobject is used extract the constituent parts of the provided union annotation.private static classExtractorFactory.ElementMapExtractorTheElementListExtractorobject is used extract the constituent parts of the provided union annotation.private static classExtractorFactory.ExtractorBuilderTheExtractorBuilderobject is used to instantiate an extractor based an a particular union annotation.
-
Field Summary
Fields Modifier and Type Field Description private ContactcontactThis is the contact that has been annotated as a union.private FormatformatThe format used for each of the extractors instantiated.private java.lang.annotation.AnnotationlabelThis is the union annotation this creates extractors for.
-
Constructor Summary
Constructors Constructor Description ExtractorFactory(Contact contact, java.lang.annotation.Annotation label, Format format)Constructor for theExtractorFactoryobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ExtractorFactory.ExtractorBuildergetBuilder(java.lang.annotation.Annotation label)This returns a builder used to instantiate an extractor based on a particular union annotation.ExtractorgetInstance()This is used to instantiate anExtractorbased on the union annotation provided.private java.lang.ObjectgetInstance(java.lang.annotation.Annotation label)This is used to instantiate anExtractorbased on the union annotation provided.
-
-
-
Field Detail
-
label
private final java.lang.annotation.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 Detail
-
ExtractorFactory
public ExtractorFactory(Contact contact, java.lang.annotation.Annotation label, Format format)
Constructor for theExtractorFactoryobject. 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 annotatedlabel- this is the union annotation to extract fromformat- this is the format used by the extractors
-
-
Method Detail
-
getInstance
public Extractor getInstance() throws java.lang.Exception
This is used to instantiate anExtractorbased 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:
java.lang.Exception
-
getInstance
private java.lang.Object getInstance(java.lang.annotation.Annotation label) throws java.lang.ExceptionThis is used to instantiate anExtractorbased 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:
java.lang.Exception
-
getBuilder
private ExtractorFactory.ExtractorBuilder getBuilder(java.lang.annotation.Annotation label) throws java.lang.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:
java.lang.Exception
-
-