Package org.jvnet.hk2.config
Class ConfigModel
java.lang.Object
org.jvnet.hk2.config.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.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal org.glassfish.hk2.api.HK2LoaderDeferred reference to the class loader that loaded the injector.final org.glassfish.hk2.api.ActiveDescriptor<? extends ConfigInjector> Reference to theConfigInjectorused to inject values to objects of this model.final StringIf this model has any property that works as a key.final StringFully-qualified name under which this type is indexed.final StringFully-qualified name of the target type that this injector works on. -
Constructor Summary
ConstructorsConstructorDescriptionConfigModel(DomDocument document, org.glassfish.hk2.api.ActiveDescriptor<? extends ConfigInjector> injector, Map<String, List<String>> description, org.glassfish.hk2.api.ServiceLocator locator) -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcamelCaseToXML(String camelCase) findIgnoreCase(String xmlName) Returns the set of possible attributes names on this configuration model.getElement(String elementName) Returns the Property model for an element associated with this model or null of the element name is not known,getElementFromXMlName(String xmlName) Returns the list of all posible elements names on this modelReturns the list of all the leaf attribute names on this model<T extends ConfigBeanProxy>
Class<T> Return the proxy type for this modelgetter for tagNametoProperty(Method method) Obtain XML names (like "abc-def") from strings like "getAbcDef" and "hasAbcDef".static StringtrimPrefix(String name)
-
Field Details
-
injector
Reference to theConfigInjectorused to inject values to objects of this model. -
classLoaderHolder
public final org.glassfish.hk2.api.HK2Loader classLoaderHolderDeferred reference to the class loader that loaded the injector. This classloader can also load the configurable object. -
targetTypeName
Fully-qualified name of the target type that this injector works on. -
keyedAs
Fully-qualified name under which this type is indexed. This is the class name where the key property is defined.Null if this type is not keyed.
-
key
If this model has any property that works as a key.- See Also:
-
-
Constructor Details
-
ConfigModel
public ConfigModel(DomDocument document, org.glassfish.hk2.api.ActiveDescriptor<? extends ConfigInjector> injector, Map<String, List<String>> description, org.glassfish.hk2.api.ServiceLocator locator) - Parameters:
description- The description of the model as written in.invalid reference
the inhabitants file
-
-
Method Details
-
getTagName
getter for tagName- Returns:
- the element name of this model itself, if this element can appear globally Otherwise null
-
getAttributeNames
Returns the set of possible attributes names on this configuration model.- Returns:
- the set of all possible attributes names on this model
-
getProxyType
Return the proxy type for this model- Type Parameters:
T- the proxy type- Returns:
- the class object for this proxy type
-
getLeafElementNames
Returns the list of all the leaf attribute names on this model- Returns:
- the list of all leaf attribute names.
-
getElementNames
Returns the list of all posible elements names on this model- Returns:
- the list of all posible elements names.
-
getElement
Returns the Property model for an element associated with this model or null of the element name is not known,- Parameters:
elementName- element name identifying the property- Returns:
- the Property instance describing the element
-
getElementFromXMlName
-
getMetadata
-
toProperty
Obtain XML names (like "abc-def") from strings like "getAbcDef" and "hasAbcDef".The conversion rule uses the model to find a good match.
-
trimPrefix
-
camelCaseToXML
-
findIgnoreCase
- Parameters:
xmlName- XML name to be searched.- Returns:
- null if none is found.
-