Class ConfigModel


  • public final class ConfigModel
    extends Object
    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
    • Field Detail

      • injector

        public final org.glassfish.hk2.api.ActiveDescriptor<? extends ConfigInjector> injector
        Reference to the ConfigInjector used to inject values to objects of this model.
      • classLoaderHolder

        public final org.glassfish.hk2.api.HK2Loader classLoaderHolder
        Deferred reference to the class loader that loaded the injector. This classloader can also load the configurable object.
      • targetTypeName

        public final String targetTypeName
        Fully-qualified name of the target type that this injector works on.
      • keyedAs

        public final String 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.

    • Constructor Detail

      • 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 the inhabitants file.
    • Method Detail

      • getTagName

        public String getTagName()
        getter for tagName
        Returns:
        the element name of this model itself, if this element can appear globally Otherwise null
      • getAttributeNames

        public Set<String> getAttributeNames()
        Returns the set of possible attributes names on this configuration model.
        Returns:
        the set of all possible attributes names on this model
      • getProxyType

        public <T extends ConfigBeanProxyClass<T> getProxyType()
        Return the proxy type for this model
        Type Parameters:
        T - the proxy type
        Returns:
        the class object for this proxy type
      • getLeafElementNames

        public Set<String> getLeafElementNames()
        Returns the list of all the leaf attribute names on this model
        Returns:
        the list of all leaf attribute names.
      • getElementNames

        public Set<String> getElementNames()
        Returns the list of all posible elements names on this model
        Returns:
        the list of all posible elements names.
      • getElement

        public 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,
        Parameters:
        elementName - element name identifying the property
        Returns:
        the Property instance describing the element
      • toProperty

        public ConfigModel.Property toProperty​(Method method)
        Obtain XML names (like "abc-def") from strings like "getAbcDef" and "hasAbcDef".

        The conversion rule uses the model to find a good match.

      • trimPrefix

        public static String trimPrefix​(String name)
      • camelCaseToXML

        public static String camelCaseToXML​(String camelCase)