Class NameAttributes


  • public class NameAttributes
    extends AttributeBase
    Model component for name attribute group in binding definition.
    Author:
    Dennis M. Sosnoski
    • Field Detail

      • s_allowedAttributes

        public static final StringArray s_allowedAttributes
        Enumeration of allowed attribute names
      • m_name

        private java.lang.String m_name
        Name text.
      • m_uri

        private java.lang.String m_uri
        Namespace URI.
      • m_prefix

        private java.lang.String m_prefix
        Namespace prefix.
      • m_isAttribute

        private boolean m_isAttribute
        Name represents an attribute flag.
      • m_namespace

        private NamespaceElement m_namespace
        Namespace definition used by this name.
    • Constructor Detail

      • NameAttributes

        public NameAttributes()
        Default constructor.
    • Method Detail

      • setIsAttribute

        public void setIsAttribute​(boolean isattr)
        Set flag for an attribute name. This information is necessary for resolving the namespace definition to be used with a name, but has to be determined by the element owning this attribute group. It must be set (if different from the default of false) prior to validation.
        Parameters:
        isattr - flag for name represents an attribute
      • isAttribute

        public boolean isAttribute()
        Get flag for an attribute name.
        Returns:
        true if an attribute, false if an element
      • getName

        public java.lang.String getName()
        Get name.
        Returns:
        name text
      • setName

        public void setName​(java.lang.String name)
        Set name.
        Parameters:
        name - text for name
      • getUri

        public java.lang.String getUri()
        Get specified namespace URI.
        Returns:
        namespace URI (null if not set)
      • setUri

        public void setUri​(java.lang.String uri)
        Set namespace URI.
        Parameters:
        uri - namespace URI (null if not set)
      • getPrefix

        public java.lang.String getPrefix()
        Get specified namespace prefix.
        Returns:
        namespace prefix (null if not set)
      • setPrefix

        public void setPrefix​(java.lang.String prefix)
        Set namespace prefix.
        Parameters:
        prefix - namespace prefix (null if not set)
      • getNamespace

        public NamespaceElement getNamespace()
        Get effective namespace definition. This call can only be used after validation.
        Returns:
        definition for namespace used by this name
      • validate

        public void validate​(ValidationContext vctx)
        Description copied from class: AttributeBase
        Validate attribute information. The validation step is used for checking the interactions between attributes, such as references to named elements and namespace usage. The AttributeBase.prevalidate(org.jibx.binding.model.ValidationContext) method will always be called for every component in the binding definition before this method is called for any component. This empty base class implementation should be overridden by each subclass that requires validation handling.
        Overrides:
        validate in class AttributeBase
        Parameters:
        vctx - validation context
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object