Class PooledTemplate

java.lang.Object
org.apache.sis.xml.Pooled
org.apache.sis.xml.PooledTemplate

final class PooledTemplate extends Pooled
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
  • Constructor Details

  • Method Details

    • setStandardProperty

      void setStandardProperty(String name, Object value)
      Indirectly invoked by the constructor (through the Pooled.setProperty(String, Object) method) for storing a property which is not one of the properties defined in the XML class. This method overwrites the values stored by the super-class, which are only null because getStandardProperty(String) is implemented that way.
      Specified by:
      setStandardProperty in class Pooled
    • getStandardProperty

      Object getStandardProperty(String name)
      Indirectly invoked by the constructor as a side-effect of Pooled.setProperty(String, Object) implementation in the super-class This method is not of interest to PooledTemplate. However, as a safety, the above setStandardProperty(String, Object) method will check that the map contains the value returned here.
      Specified by:
      getStandardProperty in class Pooled
    • remove

      String remove(String name, String defaultValue) throws PropertyException
      Remove the given value from the Pooled.initialProperties map. This method is used for values that are handled especially by the MarshallerPool 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

      protected void reset(Object key, Object value)
      Should never be invoked on PooledTemplate instances.
      Specified by:
      reset in class Pooled
      Parameters:
      key - the property to reset.
      value - the initial value to give to the property.
    • getAdapter

      public <A extends XmlAdapter> A getAdapter(Class<A> type)
      Should never be invoked on PooledTemplate instances.
      Specified by:
      getAdapter in class Pooled
    • getSchema

      public Schema getSchema()
      Should never be invoked on PooledTemplate instances.
      Specified by:
      getSchema in class Pooled
    • getEventHandler

      public ValidationEventHandler getEventHandler()
      Should never be invoked on PooledTemplate instances.
      Specified by:
      getEventHandler in class Pooled