Package org.apache.sis.xml
Class PooledTemplate
java.lang.Object
org.apache.sis.xml.Pooled
org.apache.sis.xml.PooledTemplate
The template to use for
PooledMarshaller and PooledUnmarshaller initialization.
We use this class for parsing XML property values from the map given by the user right
at MarshallerPool construction time. This allow both to catch errors sooner, and avoid
redoing the conversion every time a new (un)marshaller is requested.- Since:
- 0.3
- Version:
- 0.3
-
Field Summary
Fields inherited from class org.apache.sis.xml.Pooled
initialProperties, resetTime -
Constructor Summary
ConstructorsConstructorDescriptionPooledTemplate(Map<String, ?> properties, Implementation implementation) Creates a new template. -
Method Summary
Modifier and TypeMethodDescription<A extends XmlAdapter>
AgetAdapter(Class<A> type) Should never be invoked onPooledTemplateinstances.Should never be invoked onPooledTemplateinstances.Should never be invoked onPooledTemplateinstances.(package private) ObjectgetStandardProperty(String name) Indirectly invoked by the constructor as a side-effect ofPooled.setProperty(String, Object)implementation in the super-class This method is not of interest toPooledTemplate.(package private) StringRemove the given value from thePooled.initialPropertiesmap.protected voidShould never be invoked onPooledTemplateinstances.(package private) voidsetStandardProperty(String name, Object value) Indirectly invoked by the constructor (through thePooled.setProperty(String, Object)method) for storing a property which is not one of the properties defined in theXMLclass.Methods inherited from class org.apache.sis.xml.Pooled
begin, getProperty, getRootAdapters, getTransformVersion, initialize, isPropertySaved, reset, saveProperty, setAdapter, setAdapter, setEventHandler, setProperty, setSchema, specificBitMasks
-
Constructor Details
-
PooledTemplate
PooledTemplate(Map<String, ?> properties, Implementation implementation) throws PropertyExceptionCreates a new template.- Parameters:
properties- the properties to be given to JAXB (un)marshallers, ornullif none.implementation-Implementation.INTERNALif the JAXB implementation is the one bundled in JDK 6, orImplementation.ENDORSEDif this is the external implementation provided as a JAR file in the endorsed directory.- Throws:
PropertyException
-
-
Method Details
-
setStandardProperty
Indirectly invoked by the constructor (through thePooled.setProperty(String, Object)method) for storing a property which is not one of the properties defined in theXMLclass. This method overwrites the values stored by the super-class, which are onlynullbecausegetStandardProperty(String)is implemented that way.- Specified by:
setStandardPropertyin classPooled
-
getStandardProperty
Indirectly invoked by the constructor as a side-effect ofPooled.setProperty(String, Object)implementation in the super-class This method is not of interest toPooledTemplate. However, as a safety, the abovesetStandardProperty(String, Object)method will check that the map contains the value returned here.- Specified by:
getStandardPropertyin classPooled
-
remove
Remove the given value from thePooled.initialPropertiesmap. This method is used for values that are handled especially by theMarshallerPoolconstructor.Current implementation expects values of type
String, but this may be generalized in a future SIS version if there is a need for that.- Parameters:
name- the name of the property to remove.defaultValue- the default value to return if the given property is not defined in the map.- Returns:
- the old value of that property, or
defaultValueif the given property was not defined. - Throws:
PropertyException- if the given property is not of the expected type.
-
reset
Should never be invoked onPooledTemplateinstances. -
getAdapter
Should never be invoked onPooledTemplateinstances.- Specified by:
getAdapterin classPooled
-
getSchema
Should never be invoked onPooledTemplateinstances. -
getEventHandler
Should never be invoked onPooledTemplateinstances.- Specified by:
getEventHandlerin classPooled
-