Package org.simpleframework.xml.core
Class ExtractorFactory
- java.lang.Object
-
- org.simpleframework.xml.core.ExtractorFactory
-
class ExtractorFactory extends java.lang.Object
TheExtractorFactory
is 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 theContact
and 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 class
ExtractorFactory.ElementExtractor
TheElementExtractor
object is used extract the constituent parts of the provided union annotation.private static class
ExtractorFactory.ElementListExtractor
TheElementListExtractor
object is used extract the constituent parts of the provided union annotation.private static class
ExtractorFactory.ElementMapExtractor
TheElementListExtractor
object is used extract the constituent parts of the provided union annotation.private static class
ExtractorFactory.ExtractorBuilder
TheExtractorBuilder
object is used to instantiate an extractor based an a particular union annotation.
-
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
The format used for each of the extractors instantiated.private java.lang.annotation.Annotation
label
This 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 theExtractorFactory
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ExtractorFactory.ExtractorBuilder
getBuilder(java.lang.annotation.Annotation label)
This returns a builder used to instantiate an extractor based on a particular union annotation.Extractor
getInstance()
This is used to instantiate anExtractor
based on the union annotation provided.private java.lang.Object
getInstance(java.lang.annotation.Annotation label)
This is used to instantiate anExtractor
based 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 theExtractorFactory
object. 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 anExtractor
based 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.Exception
This is used to instantiate anExtractor
based 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
-
-