Class AbstractAttributeCollector

java.lang.Object
org.codehaus.stax2.validation.XMLValidator
com.ctc.wstx.sw.AbstractAttributeCollector
Direct Known Subclasses:
NonNsStreamWriter.AttrCollector, SimpleOutputElement.AttributeCollector

abstract class AbstractAttributeCollector extends org.codehaus.stax2.validation.XMLValidator
Base class for attribute-collecting stubs that masquerade as an XMLValidator so they can be passed to XmlWriter.writeTypedAttribute(java.lang.String, org.codehaus.stax2.ri.typed.AsciiValueEncoder) and AttributeCollector.writeAttribute(int, com.ctc.wstx.sw.XmlWriter).

Only the two validateAttribute overloads are meaningful; every other XMLValidator method throws UnsupportedOperationException because it should never be called on a collector.

Concrete subclasses are inner classes of SimpleOutputElement (namespace-aware) and NonNsStreamWriter (non-namespace-aware).

Since:
7.2
  • Constructor Details

    • AbstractAttributeCollector

      protected AbstractAttributeCollector()
  • Method Details

    • getSchema

      public org.codehaus.stax2.validation.XMLValidationSchema getSchema()
      Specified by:
      getSchema in class org.codehaus.stax2.validation.XMLValidator
    • validateElementStart

      public void validateElementStart(String localName, String uri, String prefix) throws XMLStreamException
      Specified by:
      validateElementStart in class org.codehaus.stax2.validation.XMLValidator
      Throws:
      XMLStreamException
    • validateElementAndAttributes

      public int validateElementAndAttributes() throws XMLStreamException
      Specified by:
      validateElementAndAttributes in class org.codehaus.stax2.validation.XMLValidator
      Throws:
      XMLStreamException
    • validateElementEnd

      public int validateElementEnd(String localName, String uri, String prefix) throws XMLStreamException
      Specified by:
      validateElementEnd in class org.codehaus.stax2.validation.XMLValidator
      Throws:
      XMLStreamException
    • validateText

      public void validateText(String text, boolean lastTextSegment) throws XMLStreamException
      Specified by:
      validateText in class org.codehaus.stax2.validation.XMLValidator
      Throws:
      XMLStreamException
    • validateText

      public void validateText(char[] cbuf, int textStart, int textEnd, boolean lastTextSegment) throws XMLStreamException
      Specified by:
      validateText in class org.codehaus.stax2.validation.XMLValidator
      Throws:
      XMLStreamException
    • validationCompleted

      public void validationCompleted(boolean eod) throws XMLStreamException
      Specified by:
      validationCompleted in class org.codehaus.stax2.validation.XMLValidator
      Throws:
      XMLStreamException
    • getAttributeType

      public String getAttributeType(int index)
      Specified by:
      getAttributeType in class org.codehaus.stax2.validation.XMLValidator
    • getIdAttrIndex

      public int getIdAttrIndex()
      Specified by:
      getIdAttrIndex in class org.codehaus.stax2.validation.XMLValidator
    • getNotationAttrIndex

      public int getNotationAttrIndex()
      Specified by:
      getNotationAttrIndex in class org.codehaus.stax2.validation.XMLValidator