org.bibop.xml.xforge
Class AttributeElement

java.lang.Object
  |
  +--org.bibop.xml.xforge.AbstractElement
        |
        +--org.bibop.xml.xforge.AttributeElement
All Implemented Interfaces:
org.xml.sax.ContentHandler, Element, org.xml.sax.ext.LexicalHandler, PrefixesMonitor, XMLConsumer, XMLProducer

public class AttributeElement
extends AbstractElement

Dynamically create an XML element attribute

Version:
1.0
Author:
Alberto Garoffolo
See Also:
TagElement, AttributesListener

Field Summary
private  java.lang.String attributeName
           
private  java.lang.StringBuffer attributeValue
           
static java.lang.String XFORGE_ATTR_ATTRIBUTENAME
           
 
Fields inherited from class org.bibop.xml.xforge.AbstractElement
contentHandler, lexicalHandler, parentPrefixesMonitor, po, saxEvents, xmlCompiler
 
Constructor Summary
AttributeElement(org.xml.sax.Attributes attrs, ProcessingOptions aPO)
          Look for the "name" attribute and set it as the attribute name.
 
Method Summary
 void characters(char[] ch, int start, int len)
          Receive notification of character data.
 void setContentHandler(org.xml.sax.ContentHandler xmlConsumer)
          Sets the Content Handler that will receive our xml sax events
 void setParent(XMLConsumer xmlConsumer)
          Sets the XMLConsumer that will receive our xml sax events
 void toSax()
          Adds the attribute to the element owning it.
 
Methods inherited from class org.bibop.xml.xforge.AbstractElement
comment, end, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, flushSAXCache, getActivePrefixes, ignorableWhitespace, output, output, processingInstruction, setConsumer, setDocumentLocator, setLexicalHandler, setParentPrefixesMonitor, skippedEntity, start, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attributeName

private java.lang.String attributeName

attributeValue

private java.lang.StringBuffer attributeValue

XFORGE_ATTR_ATTRIBUTENAME

public static final java.lang.String XFORGE_ATTR_ATTRIBUTENAME
See Also:
Constant Field Values
Constructor Detail

AttributeElement

public AttributeElement(org.xml.sax.Attributes attrs,
                        ProcessingOptions aPO)
                 throws IllegalElementException
Look for the "name" attribute and set it as the attribute name.

Parameters:
attrs - the Attributes object
Throws:
IllegalElementException - Attribute "name" empty or null
Method Detail

toSax

public void toSax()
           throws org.xml.sax.SAXException
Adds the attribute to the element owning it.

Specified by:
toSax in interface XMLProducer
Specified by:
toSax in class AbstractElement
Throws:
org.xml.sax.SAXException

characters

public void characters(char[] ch,
                       int start,
                       int len)
                throws org.xml.sax.SAXException
Receive notification of character data.

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class AbstractElement
Parameters:
ch - The characters from the XML document.
start - The start position in the array.
len - The number of characters to read from the array.
org.xml.sax.SAXException

setParent

public void setParent(XMLConsumer xmlConsumer)
               throws org.xml.sax.SAXException
Sets the XMLConsumer that will receive our xml sax events

Specified by:
setParent in interface Element
Overrides:
setParent in class AbstractElement
Parameters:
xmlConsumer -
org.xml.sax.SAXException

setContentHandler

public void setContentHandler(org.xml.sax.ContentHandler xmlConsumer)
                       throws org.xml.sax.SAXException
Sets the Content Handler that will receive our xml sax events

Specified by:
setContentHandler in interface XMLProducer
Overrides:
setContentHandler in class AbstractElement
org.xml.sax.SAXException


Copyright 2003 Bibop Research International. All Rights Reserved.