|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jvnet.hk2.config.ConfigModel
public final class ConfigModel
Describes the configuration model for a particular class (called "target type" in this class.) TODO: we need to remember if element values are single-valued or multi-valued.
Nested Class Summary | |
---|---|
static class |
ConfigModel.Node
|
static class |
ConfigModel.Property
|
Field Summary | |
---|---|
Holder<Class> |
classHolder
Deferred reference to the class object that can load the configurable type |
Holder<ClassLoader> |
classLoaderHolder
Deferred reference to the class loader that loaded the injector. |
Inhabitant<? extends ConfigInjector> |
injector
Reference to the ConfigInjector used to inject values to
objects of this model. |
String |
key
If this model has any property that works as a key. |
String |
keyedAs
Fully-qualified name under which this type is indexed. |
String |
targetTypeName
Fully-qualified name of the target type that this injector works on. |
Constructor Summary | |
---|---|
ConfigModel(DomDocument document,
Inhabitant<? extends ConfigInjector> injector,
Map<String,List<String>> description,
ServiceLocator locator)
|
Method Summary | ||
---|---|---|
String |
camelCaseToXML(String camelCase)
|
|
ConfigModel.Property |
findIgnoreCase(String xmlName)
Finds the ConfigModel.Property from either elements or attributes . |
|
Set<String> |
getAttributeNames()
Returns the set of possible attributes names on this configuration model. |
|
Method |
getDuckMethod(Method method)
Obtains the duck method implementation from a method on the ConfigBeanProxy -derived interface. |
|
ConfigModel.Property |
getElement(String elementName)
Returns the Property model for an element associated with this model or null of the element name is not known, |
|
ConfigModel.Property |
getElementFromXMlName(String xmlName)
|
|
Set<String> |
getElementNames()
Returns the list of all posible elements names on this model |
|
Set<String> |
getLeafElementNames()
Returns the list of all the leaf attribute names on this model |
|
Map<String,List<String>> |
getMetadata()
|
|
|
getProxyType()
Return the proxy type for this model |
|
String |
getTagName()
getter for tagName |
|
ConfigModel.Property |
toProperty(Method method)
Obtain XML names (like "abc-def") from strings like "getAbcDef" and "hasAbcDef". |
|
String |
trimPrefix(String name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Inhabitant<? extends ConfigInjector> injector
ConfigInjector
used to inject values to
objects of this model.
public final Holder<ClassLoader> classLoaderHolder
public final Holder<Class> classHolder
public final String targetTypeName
public final String keyedAs
Null if this type is not keyed.
public final String key
ConfigMetadata.KEY
Constructor Detail |
---|
public ConfigModel(DomDocument document, Inhabitant<? extends ConfigInjector> injector, Map<String,List<String>> description, ServiceLocator locator)
description
- The description of the model as written in the inhabitants file
.Method Detail |
---|
public String getTagName()
public Set<String> getAttributeNames()
public <T extends ConfigBeanProxy> Class<T> getProxyType()
T
- the proxy type
public Set<String> getLeafElementNames()
public Set<String> getElementNames()
public ConfigModel.Property getElement(String elementName)
elementName
- element name identifying the property
public ConfigModel.Property getElementFromXMlName(String xmlName)
public Map<String,List<String>> getMetadata()
public Method getDuckMethod(Method method) throws ClassNotFoundException, NoSuchMethodException
ConfigBeanProxy
-derived interface.
ClassNotFoundException
NoSuchMethodException
public ConfigModel.Property toProperty(Method method)
The conversion rule uses the model to find a good match.
public String trimPrefix(String name)
public String camelCaseToXML(String camelCase)
public ConfigModel.Property findIgnoreCase(String xmlName)
ConfigModel.Property
from either elements
or attributes
.
xmlName
- XML name to be searched.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |