Class TLcdXMLJavaClassResolver

java.lang.Object
com.luciad.format.xml.bind.TLcdXMLJavaClassResolver

public final class TLcdXMLJavaClassResolver extends Object
An XML configuration class which is used by the XML binding framework to decide for which interface or super class of a class a marshaller will be searched, in case no marshaller is available for the class itself.

Whenever no marshaller is found for the exact class to be marshalled, this resolver will make a list of all Java classes/interfaces the requested class extends or implements, and choose the one with the highest priority.

Priority algorithm

The current implementation of this class allows to register one or more list of Java classes on it. The first class in a list has the highest priority, the last class has the lowest priority. If multiple lists are registered, the lists are merged internally into a global list, in such a way that all priorities within each list are maintained. If multiple orderings are possible, it is unspecified which ordering will be chosen. If no global ordering can be found, an exception will be thrown when a violating list is registered.
Since:
8.2
  • Constructor Details

    • TLcdXMLJavaClassResolver

      public TLcdXMLJavaClassResolver()
      Constructs a new TLcdXMLJavaClassResolver with an empty class priority list.
  • Method Details

    • getSubstitutableClasses

      public List<Class<?>> getSubstitutableClasses(Class<?> aJavaClass)
    • getSubstitutableClasses

      public List<Class<?>> getSubstitutableClasses(QName aElementName, Class<?> aJavaClass)
    • registerClassPriorityList

      public void registerClassPriorityList(List<Class<?>> aClassPriorityList)
      Registers a list of classes/interfaces to which the framework can bind, if no marshaller for the exact class to be marshalled could be found.
      Parameters:
      aClassPriorityList - the list of classes to be registered.
      Throws:
      IllegalArgumentException - if the list to be registered violates one or more lists which were registered before.
    • toString

      public String toString()
      Returns a general description of this TLcdXMLJavaClassResolver, containing the global priority list with all registered classes.

      The exact details of the representation are unspecified and are subject to change.

      Overrides:
      toString in class Object