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 onPooledTemplate
instances.Should never be invoked onPooledTemplate
instances.Should never be invoked onPooledTemplate
instances.(package private) Object
getStandardProperty
(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) String
Remove the given value from thePooled.initialProperties
map.protected void
Should never be invoked onPooledTemplate
instances.(package private) void
setStandardProperty
(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 theXML
class.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, ornull
if none.implementation
-Implementation.INTERNAL
if the JAXB implementation is the one bundled in JDK 6, orImplementation.ENDORSED
if 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 theXML
class. This method overwrites the values stored by the super-class, which are onlynull
becausegetStandardProperty(String)
is implemented that way.- Specified by:
setStandardProperty
in 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:
getStandardProperty
in classPooled
-
remove
Remove the given value from thePooled.initialProperties
map. This method is used for values that are handled especially by theMarshallerPool
constructor.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
defaultValue
if the given property was not defined. - Throws:
PropertyException
- if the given property is not of the expected type.
-
reset
Should never be invoked onPooledTemplate
instances. -
getAdapter
Should never be invoked onPooledTemplate
instances.- Specified by:
getAdapter
in classPooled
-
getSchema
Should never be invoked onPooledTemplate
instances. -
getEventHandler
Should never be invoked onPooledTemplate
instances.- Specified by:
getEventHandler
in classPooled
-