Class DefaultAttrValue

java.lang.Object
com.ctc.wstx.dtd.DefaultAttrValue

public final class DefaultAttrValue extends Object
Simple container class used to contain information about the default value for an attribute. Although for most use cases a simple String would suffice, there are cases where additional information is needed (especially status of 'broken' default values, which only need to be reported should the default value be needed).
  • Field Details

  • Method Details

    • constructImplied

      public static DefaultAttrValue constructImplied()
    • constructRequired

      public static DefaultAttrValue constructRequired()
    • constructFixed

      public static DefaultAttrValue constructFixed()
    • constructOptional

      public static DefaultAttrValue constructOptional()
    • setValue

      public void setValue(String v)
    • addUndeclaredPE

      public void addUndeclaredPE(String name, Location loc)
    • addUndeclaredGE

      public void addUndeclaredGE(String name, Location loc)
    • reportUndeclared

      public void reportUndeclared(org.codehaus.stax2.validation.ValidationContext ctxt, org.codehaus.stax2.validation.XMLValidator dtd) throws XMLStreamException
      Throws:
      XMLStreamException
    • hasUndeclaredEntities

      public boolean hasUndeclaredEntities()
    • getValue

      public String getValue()
    • getValueIfOk

      public String getValueIfOk()
      Returns:
      Expanded default value String, if there were no problems (no undeclared entities), or null to indicate there were problems. In latter case, caller is to figure out exact type of the problem and report this appropriately to the application.
    • isRequired

      public boolean isRequired()
    • isFixed

      public boolean isFixed()
    • hasDefaultValue

      public boolean hasDefaultValue()
    • isSpecial

      public boolean isSpecial()
      Method used by the element to figure out if attribute needs "special" checking; basically if it's required, and/or has a default value. In both cases missing the attribute has specific consequences, either exception or addition of a default value.