Package org.jvnet.hk2.config
Class DomDocument<T extends Dom>
java.lang.Object
org.jvnet.hk2.config.DomDocument<T>
Represents a whole DOM tree.
- Author:
- Kohsuke Kawaguchi
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<org.glassfish.hk2.api.ActiveDescriptor<? extends ConfigInjector>, ConfigModel> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildModel(Class<?> clazz) Obtains aConfigModelfor the given class (Which should haveConfiguredannotation on it.)buildModel(String fullyQualifiedClassName) Obtains aConfigModelfor the given class (Which should haveConfiguredannotation on it.)getAllModelsImplementing(Class<?> intf) Calculates all @Configured interfaces subclassing the passed interface type.Deprecated.getModelByElementName(String elementName) Obtains theConfigModelfrom the "global" element name.getRoot()make(org.glassfish.hk2.api.ServiceLocator habitat, XMLStreamReader in, T parent, ConfigModel model) voidsetTranslator(Translator translator) voidWrites back the whole DOM tree as an XML document.
-
Field Details
-
models
protected final Map<org.glassfish.hk2.api.ActiveDescriptor<? extends ConfigInjector>,ConfigModel> models
-
-
Constructor Details
-
DomDocument
public DomDocument(org.glassfish.hk2.api.ServiceLocator habitat)
-
-
Method Details
-
getRoot
-
getTranslator
-
setTranslator
-
buildModel
Obtains aConfigModelfor the given class (Which should haveConfiguredannotation on it.) -
buildModel
Obtains aConfigModelfor the given class (Which should haveConfiguredannotation on it.) -
getModelByElementName
Obtains theConfigModelfrom 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
Calculates all @Configured interfaces subclassing the passed interface type.- Parameters:
intf- a @Configured interface- Returns:
- List of all @Configured subclasses
- Throws:
ClassNotFoundException
-
getModel
Deprecated. -
make
public Dom make(org.glassfish.hk2.api.ServiceLocator habitat, XMLStreamReader in, T parent, ConfigModel model) -
writeTo
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
-