org.bibop.xml.xforge
Class TagElement

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

public class TagElement
extends AbstractElement
implements AttributesListener

Dynamically creates an XML element

Version:
1.0
Author:
Alberto Garoffolo

Field Summary
private  java.util.HashMap tagAttributes
           
private  java.lang.String tagName
           
static java.lang.String XFORGE_ATTR_TAGNAME
           
 
Fields inherited from class org.bibop.xml.xforge.AbstractElement
contentHandler, lexicalHandler, parentPrefixesMonitor, po, saxEvents, xmlCompiler
 
Constructor Summary
TagElement(org.xml.sax.Attributes attrs, ProcessingOptions aPO)
          Look for the "name" attribute and set it as the element name.
 
Method Summary
 void addAttribute(java.lang.String name, java.lang.String value)
          Adds an attribute to the element to be built.
 void toSax()
          Generate appropriate SAX events
 
Methods inherited from class org.bibop.xml.xforge.AbstractElement
characters, comment, end, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, flushSAXCache, getActivePrefixes, ignorableWhitespace, output, output, processingInstruction, setConsumer, setContentHandler, setDocumentLocator, setLexicalHandler, setParent, 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

XFORGE_ATTR_TAGNAME

public static final java.lang.String XFORGE_ATTR_TAGNAME
See Also:
Constant Field Values

tagName

private java.lang.String tagName

tagAttributes

private java.util.HashMap tagAttributes
Constructor Detail

TagElement

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

Parameters:
attrs - The x:forge element attributes
Throws:
IllegalElementException - Attribute "name" empty or null
Method Detail

toSax

public void toSax()
           throws org.xml.sax.SAXException
Generate appropriate SAX events

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

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.String value)
                  throws XForgeException
Adds an attribute to the element to be built. This method is typically called by a AttributeElement object which is responsible for the attribute evaluation.

Specified by:
addAttribute in interface AttributesListener
Parameters:
name - Name of the attribute
value - value of the attribute
Throws:
XForgeException
See Also:
AttributeElement


Copyright 2003 Bibop Research International. All Rights Reserved.