|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.fotree.Namespace
public abstract class Namespace
Abstract class for handling namespaces. Subclasses should know how to convert SAX element and attribute input into Objects and Properties for their namespace.
Constructor Summary | |
---|---|
Namespace()
Constructor. |
Method Summary | |
---|---|
protected abstract PropertyList |
createNewPropertyList(Attributes attlist)
Return a newly-created appropriate PropertyList for this namespace. |
String |
formatLocator(Locator locator)
Turns a current SAX locator into a usable user message. |
abstract String |
getNamespaceURI()
Returns the URI for this namespace. |
abstract String |
getTypicalPrefix()
Returns the typical prefix for this namespace, minus the ":". |
protected void |
makeList(PropertyList propertyList,
Attributes attributes,
FObj parentFO,
int[] attributeSort,
Locator locator,
FOTreeBuilder builder)
Parses the attributes for an object in a pre-specified order, building the PropertyList from them. |
Property |
parseAttribute(Attributes attributes,
String attributeName,
String attributeValue,
FObj fobj,
Locator locator,
FOTreeBuilder builder)
Parses one attribute. |
abstract Property |
parseAttributeForNS(Attributes attributes,
String attributeName,
String attributeValue,
FObj fobj,
Locator locator)
Parses one attribute in this namespace. |
abstract void |
parseAttributes(PropertyList list,
Attributes attlist,
FObj currentFObj,
Locator locator,
FOTreeBuilder builder)
Parse the attributes for an element in this namespace. |
FObj |
parseElement(String localName,
FObj currentFObj,
PropertyList list,
Locator locator,
FOTreeBuilder builder)
Parse an element in this namespace. |
protected abstract FObj |
parseElementForNS(String localName,
FObj currentFObj,
PropertyList list,
Locator locator)
The namespace-specific logic for paring an element. |
void |
reset()
Resets the error count for this namespace. |
protected int[] |
sortAttributes(Attributes attlist)
Reads through the list of attributes and returns an array that contains the order in which they should be processed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Namespace()
Method Detail |
---|
public abstract String getNamespaceURI()
public abstract String getTypicalPrefix()
public FObj parseElement(String localName, FObj currentFObj, PropertyList list, Locator locator, FOTreeBuilder builder) throws org.axsl.fo.FoTreeException
localName
- The local name of the element.currentFObj
- The current FObj, that is, the parent of the one
being parsed.list
- The property list into which properties for the new FObj
should be placed.locator
- The SAX locator.builder
- The FO Tree builder.
org.axsl.fo.FoTreeException
- For parsing errors.protected abstract FObj parseElementForNS(String localName, FObj currentFObj, PropertyList list, Locator locator) throws org.axsl.fo.FoTreeException
localName
- The local name of the element.currentFObj
- The current FObj, that is, the parent of the one
being parsed.list
- The property list into which properties for the new FObj
should be placed.locator
- The SAX locator.
org.axsl.fo.FoTreeException
- For parsing errors.public String formatLocator(Locator locator)
locator
- The SAX locator containing the location information.
public abstract void parseAttributes(PropertyList list, Attributes attlist, FObj currentFObj, Locator locator, FOTreeBuilder builder) throws org.axsl.fo.FoTreeException
list
- The property list into which the parsed values should be
placed.attlist
- The unparsed SAX attributes.currentFObj
- The FObj instance to whom the attributes belong.locator
- The SAX locator.builder
- The FOTree builder.
org.axsl.fo.FoTreeException
- For errors during attribute/property parsing.protected int[] sortAttributes(Attributes attlist)
attlist
- The Attributes instance that contains the attributes to
be sorted
public Property parseAttribute(Attributes attributes, String attributeName, String attributeValue, FObj fobj, Locator locator, FOTreeBuilder builder) throws PropertyException
attributes
- The unparsed SAX attributes.attributeName
- The name of the attribute to be parsed.attributeValue
- The value of the attribute to be parsed.fobj
- The FObj to which the properties belong.locator
- The SAX locator.builder
- The FOTree builder.
PropertyException
- For errors during parsing.public abstract Property parseAttributeForNS(Attributes attributes, String attributeName, String attributeValue, FObj fobj, Locator locator) throws PropertyException
attributes
- The unparsed SAX attributes.attributeName
- The name of the attribute to be parsed.attributeValue
- The value of the attribute to be parsed.fobj
- The FObj to which the properties belongs.locator
- The SAX locator.
PropertyException
- For errors during parsing.protected void makeList(PropertyList propertyList, Attributes attributes, FObj parentFO, int[] attributeSort, Locator locator, FOTreeBuilder builder) throws PropertyException
propertyList
- The property list into which the parsed values should
be placed.attributes
- The unparsed SAX attributes.parentFO
- The parent FO.attributeSort
- The order in which the various attributes should be
parsed, so that compound values are handled properly.locator
- The SAX locator.builder
- The FO Tree builder.
PropertyException
- For errors during parsing.public void reset()
protected abstract PropertyList createNewPropertyList(Attributes attlist)
attlist
- The attributes that will become the properties in the
list.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |