Class MappingElementBase

Direct Known Subclasses:
MappingElement, PrecompiledMappingElement

public abstract class MappingElementBase extends TemplateElementBase
Model component for mapping element of binding definition. Subclasses are used for mappings in normal or precompiled bindings.
Author:
Dennis M. Sosnoski
  • Field Details

    • s_allowedAttributes

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

      private boolean m_isAbstract
      Abstract mapping flag.
    • m_nameAttrs

      private NameAttributes m_nameAttrs
      Name attributes information for nesting.
    • m_extendsName

      private String m_extendsName
      Name of mapped class extended by this mapping.
    • m_typeQName

      private QName m_typeQName
      Type qualified name (defaults to fully-qualified class name in no-namespace namespace).
  • Constructor Details

    • MappingElementBase

      public MappingElementBase(int type)
      Constructor.
      Parameters:
      type - element type code
  • Method Details

    • isAbstract

      public boolean isAbstract()
      Check for abstract mapping.
      Returns:
      true if abstract, false if not
    • setAbstract

      public void setAbstract(boolean abs)
      Set abstract mapping.
      Parameters:
      abs - true if abstract, false if not
    • getTypeName

      public String getTypeName()
      Get type name.
      Returns:
      type name
    • setTypeName

      public void setTypeName(String name)
      Set type name.
      Parameters:
      name - type name
    • getTypeQName

      public QName getTypeQName()
      Get type qualified name.
      Returns:
      type qualified name
    • setTypeQName

      public void setTypeQName(QName qname)
      Set type qualified name.
      Parameters:
      qname - type qualified name
    • isDefaultTemplate

      public boolean isDefaultTemplate()
      Check if this is a default template.
      Specified by:
      isDefaultTemplate in class TemplateElementBase
      Returns:
      true if default, false if not
    • getNameAttributes

      public NameAttributes getNameAttributes()
      Get name attributes. This is provided for use with the name attributes as a hash key.
      Returns:
      name attributes structure
    • getName

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

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

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

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

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

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

      public NamespaceElement getNamespace()
      Get effective namespace information. This call is only meaningful after validation.
      Returns:
      effective namespace information
    • preSet

      private void preSet(IUnmarshallingContext uctx) throws JiBXException
      Make sure all attributes are defined.
      Parameters:
      uctx - unmarshalling context
      Throws:
      JiBXException - on unmarshalling error
    • setExtendsName

      public void setExtendsName(String name)
      Set name of mapped class extended by this one.
      Parameters:
      name -
    • getExtendsName

      public String getExtendsName()
      Get name of mapped class extended by this one.
      Returns:
      name
    • setQualifiedTypeName

      private void setQualifiedTypeName(String text, IUnmarshallingContext ictx) throws JiBXException
      JiBX access method to set mapping type name as qualified name.
      Parameters:
      text - mapping name text (null if none)
      ictx - unmarshalling context
      Throws:
      JiBXException - on deserialization error
    • getQualifiedTypeName

      private String getQualifiedTypeName(IMarshallingContext ictx) throws JiBXException
      JiBX access method to get mapping type name as qualified name.
      Parameters:
      ictx - marshalling context
      Returns:
      mapping type name text (null if none)
      Throws:
      JiBXException - on deserialization error
    • prevalidate

      public void prevalidate(ValidationContext vctx)
      Description copied from class: ElementBase
      Prevalidate element information. The prevalidation step is used to check isolated aspects of an element, such as the settings for enumerated values on the element and attributes. This empty base class implementation should be overridden by each subclass that requires prevalidation handling.
      Overrides:
      prevalidate in class TemplateElementBase
      Parameters:
      vctx - validation context
    • validate

      public void validate(ValidationContext vctx)
      Description copied from class: ElementBase
      Validate element information. The validation step is used for checking the interactions between elements, such as name references to other elements. The ElementBase.prevalidate(org.jibx.binding.model.ValidationContext) method will always be called for every element in the binding definition before this method is called for any element. This empty base class implementation should be overridden by each subclass that requires validation handling.
      Overrides:
      validate in class TemplateElementBase
      Parameters:
      vctx - validation context