Class EnvironmentProperty

    • Field Detail

      • mappedName

        protected String mappedName
      • lookupName

        protected String lookupName
    • Constructor Detail

      • EnvironmentProperty

        public EnvironmentProperty​(EnvironmentProperty other)
        copy constructor.
        Parameters:
        other -
      • EnvironmentProperty

        public EnvironmentProperty()
        Construct an environment property if type String and empty string value and no description.
      • EnvironmentProperty

        public EnvironmentProperty​(String name,
                                   String value,
                                   String description)
        Construct an environment property of given name value and description.
        Parameters:
        name -
        value -
        description -
      • EnvironmentProperty

        public EnvironmentProperty​(String name,
                                   String value,
                                   String description,
                                   String type)
        Construct an environment property of given name value and description and type. Throws an IllegalArgumentException if bounds checking is true and the value cannot be reconciled with the given type.
        Parameters:
        name -
        value -
        description -
        type -
    • Method Detail

      • getValue

        public String getValue()
        Returns the String value of this environment property
        Specified by:
        getValue in interface NameValuePair
        Returns:
      • getResolvedValue

        public String getResolvedValue()
        Returns a resolved value of this environment property
        Returns:
      • getResolvedValueObject

        public Object getResolvedValueObject()
        Returns the typed value object of this environment property. Throws an IllegalArgumentException if bounds checking is true and the value cannot be reconciled with the given type.
        Returns:
      • getValueObject

        public Object getValueObject()
        Returns the typed value object of this environment property. Throws an IllegalArgumentException if bounds checking is true and the value cannot be reconciled with the given type.
        Returns:
      • getValueType

        public Class getValueType()
        Returns value type of this environment property.
        Returns:
      • setType

        public void setType​(String type)
        Returns value type of this environment property. Throws Illegal argument exception if this is not an allowed type and bounds checking.
        Specified by:
        setType in interface EnvironmentEntry
        Parameters:
        type -
      • getType

        public String getType()
        Returns value type of this environment property as a classname.
        Specified by:
        getType in interface EnvironmentEntry
        Returns:
      • setMappedName

        public void setMappedName​(String mName)
      • getMappedName

        public String getMappedName()
        Returns:
        the mapped name or an empty string if not set
      • setLookupName

        public void setLookupName​(String lName)
        Sets the lookup name
        Parameters:
        lName -
      • getLookupName

        public String getLookupName()
        Gets the lookup value
        Returns:
        the lookupname or an empty string if not set
      • hasLookupName

        public boolean hasLookupName()
        Returns:
        true if lookup is not null and non-zero length
      • setValue

        public void setValue​(String value)
        Sets the value of the environment property to the given string.
        Specified by:
        setValue in interface NameValuePair
        Parameters:
        value -
      • isSetValueCalled

        public boolean isSetValueCalled()
        Returns true if the value of the environment property has been set
        Returns:
      • hasAValue

        public boolean hasAValue()
      • equals

        public boolean equals​(Object other)
        Returns true if the argument is an environment property of the same name, false else.
        Overrides:
        equals in class Object
        Parameters:
        other -
      • hashCode

        public int hashCode()
        The hashCode of an environment property is the same as that of the name String.
        Overrides:
        hashCode in class Object
      • print

        public void print​(StringBuilder toStringBuilder)
        Returns a String representation of this environment property.
        Overrides:
        print in class Descriptor
        Parameters:
        toStringBuilder -
      • isConflictResourceGroup

        protected boolean isConflictResourceGroup​(EnvironmentProperty other)
      • isInjectable

        public boolean isInjectable()
        Description copied from interface: InjectionCapable
        True if a particular resource instance is injectable. All injectable resources are also exposed via their corresponding java:comp/env namespaces, but not all resources in java:comp/env are injectable. A resource is either field injectable or method injectable but never both.
        Specified by:
        isInjectable in interface InjectionCapable
      • hasInjectionTargetFromXml

        public boolean hasInjectionTargetFromXml()
      • getComponentEnvName

        public String getComponentEnvName()
        Description copied from interface: InjectionCapable
        ComponentEnvName is the name of the corresponding java:comp/env entry for the object that is to be injected.
        Specified by:
        getComponentEnvName in interface InjectionCapable