Class MetadataTypes

java.lang.Object
org.apache.sis.internal.jaxb.TypeRegistration
org.apache.sis.internal.metadata.MetadataTypes
All Implemented Interfaces:
Function<Object,Object>, UnaryOperator<Object>

public final class MetadataTypes extends TypeRegistration implements UnaryOperator<Object>
Declares the classes of objects to be marshalled using a default MarshallerPool. This class is declared in the META-INF/services/org.apache.sis.internal.jaxb.TypeRegistration file.
Since:
0.3
Version:
1.0
  • Constructor Details

    • MetadataTypes

      public MetadataTypes()
  • Method Details

    • getTypes

      protected void getTypes(Collection<Class<?>> addTo)
      Adds to the given collection the metadata types that should be given to the initial JAXB context.
      Specified by:
      getTypes in class TypeRegistration
      Parameters:
      addTo - the collection in which to add new types.
    • beforeMarshal

      protected UnaryOperator<Object> beforeMarshal()
      Returns the converter to apply before marshalling objects.
      Overrides:
      beforeMarshal in class TypeRegistration
      Returns:
      this.
    • apply

      public Object apply(Object value)
      Ensures that the given value is an instance of a class that can be marshalled, or returns null if the type of the given value is not handled by this method. Current implementation handles all types that may need to be put in the ISO 19115-3 namespace; we have to do that ourself because those classes are not public. Other types may be added if needed, but we do not want to handle too many of them (for performance reasons). However, the list or recognized types shall contain at least Metadata.
      Specified by:
      apply in interface Function<Object,Object>
      Parameters:
      value - the value to marshal.
      Returns:
      the given value as a type that can be marshalled, or null.