Class DomDocument<T extends Dom>

java.lang.Object
org.jvnet.hk2.config.DomDocument<T>

public class DomDocument<T extends Dom> extends Object
Represents a whole DOM tree.
Author:
Kohsuke Kawaguchi
  • Field Details

  • Constructor Details

    • DomDocument

      public DomDocument(org.glassfish.hk2.api.ServiceLocator habitat)
  • Method Details

    • getRoot

      public Dom getRoot()
    • getTranslator

      public Translator getTranslator()
    • setTranslator

      public void setTranslator(Translator translator)
    • buildModel

      public ConfigModel buildModel(Class<?> clazz)
      Obtains a ConfigModel for the given class (Which should have Configured annotation on it.)
    • buildModel

      public ConfigModel buildModel(String fullyQualifiedClassName)
      Obtains a ConfigModel for the given class (Which should have Configured annotation on it.)
    • getModelByElementName

      public ConfigModel getModelByElementName(String elementName)
      Obtains the ConfigModel from the "global" element name.

      This method uses buildModel(org.glassfish.hk2.api.ActiveDescriptor<? extends org.jvnet.hk2.config.ConfigInjector>) to lazily build models if necessary.

      Returns:
      Null if no configurable component is registered under the given global element name.
    • getAllModelsImplementing

      public List<ConfigModel> getAllModelsImplementing(Class<?> intf) throws ClassNotFoundException
      Calculates all @Configured interfaces subclassing the passed interface type.
      Parameters:
      intf - a @Configured interface
      Returns:
      List of all @Configured subclasses
      Throws:
      ClassNotFoundException
    • getModel

      @Deprecated public ConfigModel getModel(Class c)
      Deprecated.
    • make

      public Dom make(org.glassfish.hk2.api.ServiceLocator habitat, XMLStreamReader in, T parent, ConfigModel model)
    • writeTo

      public void writeTo(XMLStreamWriter w) throws XMLStreamException
      Writes back the whole DOM tree as an XML document.

      To support writing a subtree, this method doesn't invoke the start/endDocument events. Those are the responsibility of the caller.

      Parameters:
      w - Receives XML infoset stream.
      Throws:
      XMLStreamException