import org.apache.fop.apps.FOPException;
import org.apache.fop.datatypes.Ints;
import org.apache.fop.fo.expr.PropertyException;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.Namespaces;
/**
* @param foNode - the <tt>FONode</tt> with which these attributes are
* associated.
*/
- public FOAttributes(XMLEvent event, FONode foNode) throws FOPException {
+ public FOAttributes(XmlEvent event, FONode foNode) throws FOPException {
// If the event is null, there is no event associated with this
// node, probably because this is a manufactured node; e.g.,
// includes an empty foAttrMap HashMap.
if (event == null) return;
- if (event.getType() == XMLEvent.CHARACTERS)
+ if (event.getType() == XmlEvent.CHARACTERS)
return; // go with the empty foAttrMap
// Create the foAttrMap.
Attributes attributes = event.getAttributes();
if (attributes == null) throw new FOPException
- ("No Attributes in XMLEvent");
+ ("No Attributes in XmlEvent");
for (int i = 0; i < attributes.getLength(); i++) {
String attrUri = attributes.getURI(i);
String attrLocalname = attributes.getLocalName(i);
* Get an unmodifiable <tt>Map</tt> of the attribute values for a
* particular namespace.
* @param uriIndex an <tt>int</tt> containing the index of the attribute
- * values namespace, maintained in an <tt>XMLEvent</tt> <tt>static</tt>
+ * values namespace, maintained in an <tt>XmlEvent</tt> <tt>static</tt>
* array.
* @return an unmodifiable <tt>Map</tt> of the attribute values
* within the indexed namespace, for this attribute list, indexed by the
/**
* Get the value of an attribute in a particular namespace.
* @param uriIndex an <tt>int</tt> index of the URIs maintained
- * by <tt>XMLEvent</tt>.
+ * by <tt>XmlEvent</tt>.
* @param localName a <tt>String</tt> with the local name of the
* attribute. In the case of the default attribute namespace, this
* will be the fo property name.
import org.apache.fop.fo.expr.PropertyParser;
import org.apache.fop.fo.properties.Property;
import org.apache.fop.messaging.MessageHandler;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.Namespaces;
* @param type the fo type of this FONode.
* @param parent an <tt>FONode</tt>, the parent node of this node in
* <i>foTree</i>
- * @param event the <tt>XMLEvent</tt> that triggered the creation of this
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of this
* node.
* @param stateFlags - the set of states relevant at this point in the
* tree. Includes the state information necessaryto select an attribute
* properties.
*/
public FONode
- (FOTree foTree, int type, FONode parent, XMLEvent event,
+ (FOTree foTree, int type, FONode parent, XmlEvent event,
int stateFlags, int[] sparsePropsMap, int[] sparseIndices)
throws TreeException, FOPException, PropertyException
{
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.fo.expr.PropertyParser;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
* <tt>FOTree</tt> is the class that generates and maintains the FO Tree.
private static final String revision = "$Revision$";
/**
- * The buffer from which the <tt>XMLEvent</tt>s from the parser will
+ * The buffer from which the <tt>XmlEvent</tt>s from the parser will
* be read. <tt>protected</tt> so that FONode can access it.
*/
protected SyncedXmlEventsBuffer xmlevents;
protected PropertyParser exprParser;
/**
- * @param xmlevents the buffer from which <tt>XMLEvent</tt>s from the
+ * @param xmlevents the buffer from which <tt>XmlEvent</tt>s from the
* parser are read.
*/
public FOTree(SyncedXmlEventsBuffer xmlevents)
*/
public void run() {
FoRoot foRoot;
- XMLEvent event;
+ XmlEvent event;
try {
// Let the parser look after STARTDOCUMENT and the correct
// positioning of the root element
import org.apache.fop.datatypes.Ints;
import org.apache.fop.fo.flow.FoPcdata;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
* Data class for common data and methods relating to Flow Objects.
/**
* This method generates generates new FO objects, except for FoPcdata
- * objects, which require an XMLEvent argument. Use only when it is
+ * objects, which require an XmlEvent argument. Use only when it is
* known that no CHARACTERS event will be passed.
* @param foTree
* @param parent
* This method generates generates new FO objects, including FoPcdata
* objects. It is more general in this sense than the overloaded
* version which takes the <code>FoXMLEvent event</code> parameter.
- * objects, which require an XMLEvent argument.
+ * objects, which require an XmlEvent argument.
* @param foTree
* @param parent
- * @param event the <code>XMLEvent</code> which triggered the generation
+ * @param event the <code>XmlEvent</code> which triggered the generation
* of this fo
* @param stateFlags
* @return
* @throws FOPException
*/
public Object makeFlowObject(FOTree foTree,
- FONode parent, XMLEvent event, int stateFlags)
+ FONode parent, XmlEvent event, int stateFlags)
throws FOPException
{
if (event instanceof FoXMLEvent) {
return makeFlowObject(
foTree, parent, (FoXMLEvent)event, stateFlags);
}
- if (event.getType() != XMLEvent.CHARACTERS) {
+ if (event.getType() != XmlEvent.CHARACTERS) {
throw new FOPException(
- "Attempt to makeFlowObject() with XMLEvent for event type "
- + XMLEvent.eventTypeName(event.getType()));
+ "Attempt to makeFlowObject() with XmlEvent for event type "
+ + XmlEvent.eventTypeName(event.getType()));
}
return new FoPcdata(foTree, parent, event, stateFlags);
}
import org.apache.fop.fo.pagination.FoLayoutMasterSet;
import org.apache.fop.xml.FoXMLEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.Namespaces;
/**
/**
* @param foTree the FO tree being built
- * @param event the <tt>XMLEvent</tt> that triggered the creation of this
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of this
* node
*/
public FoRoot
- (FOTree foTree, XMLEvent event)
+ (FOTree foTree, XmlEvent event)
throws TreeException, FOPException, PropertyException
{
// This is the root node of the tree; hence the null argument
* in the page-sequence-sequence.
*/
public void buildFoTree() throws FOPException{
- XMLEvent ev;
+ XmlEvent ev;
String nowProcessing;
//System.out.println("buildFoTree: " + event);
nowProcessing = "layout-master-set";
try {
// Look for layout-master-set. Must be one.
ev = xmlevents.expectStartElement
- (FObjectNames.LAYOUT_MASTER_SET, XMLEvent.DISCARD_W_SPACE);
+ (FObjectNames.LAYOUT_MASTER_SET, XmlEvent.DISCARD_W_SPACE);
// Process the layout-master-set
FoLayoutMasterSet layoutMasters =
new FoLayoutMasterSet(getFOTree(), this, ev);
// Look for optional declarations
nowProcessing = "declarations";
ev = xmlevents.expectStartElement
- (FObjectNames.DECLARATIONS, XMLEvent.DISCARD_W_SPACE);
+ (FObjectNames.DECLARATIONS, XmlEvent.DISCARD_W_SPACE);
if (ev != null) {
// process the declarations
declarations = numChildren();
// must have at least one
nowProcessing = "page-sequence";
ev = xmlevents.expectStartElement
- (FObjectNames.PAGE_SEQUENCE, XMLEvent.DISCARD_W_SPACE);
+ (FObjectNames.PAGE_SEQUENCE, XmlEvent.DISCARD_W_SPACE);
if (ev == null)
throw new FOPException("No page-sequence found.");
firstPageSeq = numChildren();
ev = xmlevents.getEndElement(SyncedXmlEventsBuffer.DISCARD_EV, ev);
namespaces.surrenderEvent(ev);
while ((ev = xmlevents.expectStartElement
- (FObjectNames.PAGE_SEQUENCE, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.PAGE_SEQUENCE, XmlEvent.DISCARD_W_SPACE))
!= null) {
// Loop over remaining fo:page-sequences
new FoPageSequence(getFOTree(), this, (FoXMLEvent)ev);
import org.apache.fop.fo.FOTree;
import org.apache.fop.fo.FObjectNames;
import org.apache.fop.fo.PropNames;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
* Implements the fo:simple-page-master flow object
* @param event the <tt>FoXMLEvent</tt> that triggered the creation of
* this node
*/
- public FoColorProfile(FOTree foTree, FONode parent, XMLEvent event)
+ public FoColorProfile(FOTree foTree, FONode parent, XmlEvent event)
throws TreeException, FOPException
{
super(foTree, FObjectNames.COLOR_PROFILE, parent, event,
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
* <tt>FoLayoutMasterSet</tt> is the class which processes the
/**
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
*/
public FoDeclarations
- (FOTree foTree, FONode parent, XMLEvent event)
+ (FOTree foTree, FONode parent, XmlEvent event)
throws TreeException, FOPException, PropertyException
{
super(foTree, FObjectNames.DECLARATIONS, parent, event,
FONode.DECLARATIONS_SET, sparsePropsMap, sparseIndices);
try {
- XMLEvent ev =
+ XmlEvent ev =
xmlevents.expectStartElement
- (FObjectNames.COLOR_PROFILE, XMLEvent.DISCARD_W_SPACE);
+ (FObjectNames.COLOR_PROFILE, XmlEvent.DISCARD_W_SPACE);
if (ev == null)
throw new FOPException
("No fo:color-profile in fo:declarations.");
namespaces.surrenderEvent(ev);
do {
ev = xmlevents.expectStartElement
- (FObjectNames.COLOR_PROFILE, XMLEvent.DISCARD_W_SPACE);
+ (FObjectNames.COLOR_PROFILE, XmlEvent.DISCARD_W_SPACE);
if (ev == null) break; // No instance of these elements found
new FoColorProfile(foTree, this, ev);
// Flush the master event
import org.apache.fop.fo.PropertySets;
import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:basic-link: (#PCDATA|%inline;|%block;)*
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.BASIC_LINK, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev = null;
+ XmlEvent ev = null;
do {
try {
if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0)
//System.out.println("Generating flow object for " + ev);
FObjects.fobjects.makeFlowObject(
foTree, this, ev, stateFlags);
- if (ev.getType() != XMLEvent.CHARACTERS)
+ if (ev.getType() != XmlEvent.CHARACTERS)
ev = xmlevents.getEndElement(
SyncedXmlEventsBuffer.DISCARD_EV, ev);
namespaces.surrenderEvent(ev);
import org.apache.fop.fo.PropertySets;
import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:bidi-override: (#PCDATA|%inline;|%block;)*
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.BIDI_OVERRIDE, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev = null;
+ XmlEvent ev = null;
do {
try {
if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0)
// Generate the flow object
FObjects.fobjects.makeFlowObject(
foTree, this, ev, stateFlags);
- if (ev.getType() != XMLEvent.CHARACTERS)
+ if (ev.getType() != XmlEvent.CHARACTERS)
ev = xmlevents.getEndElement(
SyncedXmlEventsBuffer.DISCARD_EV, ev);
namespaces.surrenderEvent(ev);
import org.apache.fop.fo.PropertySets;
import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:inline: (#PCDATA|%inline;|%block;)*
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.BLOCK, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev = null;
+ XmlEvent ev = null;
do {
try {
if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0)
//System.out.println("Generating flow object for " + ev);
FObjects.fobjects.makeFlowObject(
foTree, this, ev, stateFlags);
- if (ev.getType() != XMLEvent.CHARACTERS) {
+ if (ev.getType() != XmlEvent.CHARACTERS) {
ev = xmlevents.getEndElement(
SyncedXmlEventsBuffer.DISCARD_EV, ev);
}
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.PropertySets;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:block-container: (%block;)+
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
// absolutely positioned areas. They are not allowed as descendents
// of fo:title, fo:float or fo:footnote. They are not allowed to
// have any fo:marker children.
- XMLEvent ev = null;
+ XmlEvent ev = null;
try {
// Get at least one %block;
if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0)
import org.apache.fop.fo.FObjects;
import org.apache.fop.fo.PropNames;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:float: (%block;+)
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.FLOAT, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev = null;
+ XmlEvent ev = null;
if ((stateFlags & (FONode.MC_FLOAT | FONode.MC_FOOTNOTE)) != 0)
throw new FOPException
("float not permitted as descendent of float or footnote.");
import org.apache.fop.fo.FObjects;
import org.apache.fop.fo.PropNames;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:flow (%block;)+
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
*/
public FoFlow(FOTree foTree, FONode parent, FoXMLEvent event)
{
super(foTree, FObjectNames.FLOW, parent, event,
FONode.FLOW_SET, sparsePropsMap, sparseIndices);
- XMLEvent ev;
+ XmlEvent ev;
try {
// Get at least one %block;
if ((ev = xmlevents.expectBlock()) == null)
import org.apache.fop.fo.PropertySets;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
/**
* <p>Content model for fo:footnote: (inline,footnote-body)
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
if ((stateFlags & FONode.MC_FOOTNOTE) != 0)
throw new FOPException
("fo:footnote not allowed as child of fo:footnote.");
- XMLEvent ev;
+ XmlEvent ev;
try {
// Look for the inline
if ((ev = xmlevents.expectStartElement
- (FObjectNames.INLINE, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.INLINE, XmlEvent.DISCARD_W_SPACE))
== null)
throw new FOPException("No inline in footnote.");
new FoInline(
// Look for the footnote-body
if ((ev = xmlevents.expectStartElement
- (FObjectNames.FOOTNOTE_BODY, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.FOOTNOTE_BODY, XmlEvent.DISCARD_W_SPACE))
== null)
throw new FOPException("No footnote-body in footnote.");
new FoFootnoteBody(
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.PropertySets;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:footnote-body: (%block;+)
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.FOOTNOTE_BODY, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev = null;
+ XmlEvent ev = null;
try {
// Get at least one %block;
if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0)
import org.apache.fop.fo.PropertySets;
import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:inline: (#PCDATA|%inline;|%block;)*
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.INLINE, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev = null;
+ XmlEvent ev = null;
do {
try {
if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0)
//System.out.println("Generating flow object for " + ev);
FObjects.fobjects.makeFlowObject(
foTree, this, ev, stateFlags);
- if (ev.getType() != XMLEvent.CHARACTERS) {
+ if (ev.getType() != XmlEvent.CHARACTERS) {
ev = xmlevents.getEndElement(
SyncedXmlEventsBuffer.DISCARD_EV, ev);
}
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.PropertySets;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:inline-container (%block;)+
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.INLINE_CONTAINER, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev = null;
+ XmlEvent ev = null;
try {
// Get at least one %block;
if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0)
import org.apache.fop.fo.PropertySets;
import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:leader: (#PCDATA|%inline;)*
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.LEADER, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev = null;
+ XmlEvent ev = null;
do {
try {
if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0)
//System.out.println("Generating flow object for " + ev);
FObjects.fobjects.makeFlowObject(
foTree, this, ev, stateFlags);
- if (ev.getType() != XMLEvent.CHARACTERS) {
+ if (ev.getType() != XmlEvent.CHARACTERS) {
ev = xmlevents.getEndElement(
SyncedXmlEventsBuffer.DISCARD_EV, ev);
}
import org.apache.fop.fo.PropertySets;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
/**
* <p>Content model for fo:list-block: (marker*, list-item+)
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.LIST_BLOCK, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev;
+ XmlEvent ev;
// Look for zero or more markers
String nowProcessing = "marker";
try {
while ((ev = xmlevents.expectStartElement
- (FObjectNames.MARKER, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.MARKER, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoMarker(getFOTree(), this, (FoXMLEvent)ev, stateFlags);
numMarkers++;
// Look for one or more table-rows
nowProcessing = "list-item";
while ((ev = xmlevents.expectStartElement
- (FObjectNames.LIST_ITEM, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.LIST_ITEM, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoListItem(getFOTree(), this, (FoXMLEvent)ev, stateFlags);
numItems++;
import org.apache.fop.fo.PropertySets;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
/**
* (marker*, list-item-label,list-item-body)
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.LIST_ITEM, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev;
+ XmlEvent ev;
// Look for zero or more markers
String nowProcessing = "marker";
try {
while ((ev = xmlevents.expectStartElement
- (FObjectNames.MARKER, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.MARKER, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoMarker(getFOTree(), this, (FoXMLEvent)ev, stateFlags);
numMarkers++;
// Look for one list-item-label
nowProcessing = "list-item-label";
if ((ev = xmlevents.expectStartElement
- (FObjectNames.LIST_ITEM_LABEL, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.LIST_ITEM_LABEL, XmlEvent.DISCARD_W_SPACE))
== null)
throw new FOPException
("No list-item-label in list-item.");
// Look for one list-item-body
nowProcessing = "list-item-body";
if ((ev = xmlevents.expectStartElement
- (FObjectNames.LIST_ITEM_BODY, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.LIST_ITEM_BODY, XmlEvent.DISCARD_W_SPACE))
== null)
throw new FOPException
("No list-item-body in list-item.");
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.PropertySets;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:list-item-body: (marker*, %block;+)
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.LIST_ITEM_BODY, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev = null;
+ XmlEvent ev = null;
try {
// Get at least one %block;
if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0)
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.PropertySets;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:list-item-label: (marker*, %block;+)
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.LIST_ITEM_LABEL, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev = null;
+ XmlEvent ev = null;
try {
// Get at least one %block;
if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0)
import org.apache.fop.fo.PropNames;
import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:inline: (marker*,(#PCDATA|%inline;|%wrapper;)*)
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
if ((stateFlags & FONode.FLOW) == 0)
throw new FOPException
("fo:marker must be descendent of fo:flow.");
- XMLEvent ev = null;
+ XmlEvent ev = null;
do {
try {
if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0)
//System.out.println("Generating flow object for " + ev);
FObjects.fobjects.makeFlowObject(
foTree, this, ev, stateFlags);
- if (ev.getType() != XMLEvent.CHARACTERS) {
+ if (ev.getType() != XmlEvent.CHARACTERS) {
ev = xmlevents.getEndElement(
SyncedXmlEventsBuffer.DISCARD_EV, ev);
}
import org.apache.fop.fo.PropertySets;
import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
super(foTree, FObjectNames.MULTI_CASE, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
stateFlags |= FONode.MC_MULTI_CASE;
- XMLEvent ev = null;
+ XmlEvent ev = null;
do {
try {
if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0)
//System.out.println("Generating flow object for " + ev);
FObjects.fobjects.makeFlowObject
(foTree, this, ev, stateFlags);
- if (ev.getType() != XMLEvent.CHARACTERS) {
+ if (ev.getType() != XmlEvent.CHARACTERS) {
ev = xmlevents.getEndElement(
SyncedXmlEventsBuffer.DISCARD_EV, ev);
}
import org.apache.fop.fo.PropertySets;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
/**
{
super(foTree, FObjectNames.MULTI_PROPERTIES, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev;
+ XmlEvent ev;
try {
// Look for one or more multi-property-set
while ((ev = xmlevents.expectStartElement
(FObjectNames.MULTI_PROPERTY_SET,
- XMLEvent.DISCARD_W_SPACE))
+ XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoMultiPropertySet(
getFOTree(), this, (FoXMLEvent)ev, stateFlags);
// Look for the wrapper
if ((ev = xmlevents.expectStartElement
- (FObjectNames.WRAPPER, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.WRAPPER, XmlEvent.DISCARD_W_SPACE))
== null)
throw new FOPException
("No wrapper in multi-properties.");
import org.apache.fop.fo.PropertySets;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
/**
{
super(foTree, FObjectNames.MULTI_SWITCH, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev;
+ XmlEvent ev;
try {
// Look for one or more multi-case
while ((ev = xmlevents.expectStartElement
- (FObjectNames.MULTI_CASE, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.MULTI_CASE, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoMultiCase(
getFOTree(), this, (FoXMLEvent)ev, stateFlags);
import org.apache.fop.fo.PropertySets;
import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
{
super(foTree, FObjectNames.MULTI_TOGGLE, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev = null;
+ XmlEvent ev = null;
if ((stateFlags & FONode.MC_MULTI_CASE) != 0)
do {
try {
//System.out.println("Generating flow object for " + ev);
FObjects.fobjects.makeFlowObject
(foTree, this, ev, stateFlags);
- if (ev.getType() != XMLEvent.CHARACTERS) {
+ if (ev.getType() != XmlEvent.CHARACTERS) {
ev = xmlevents.getEndElement(
SyncedXmlEventsBuffer.DISCARD_EV, ev);
}
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
/**
/**
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
*/
public FoPageSequence(FOTree foTree, FONode parent, FoXMLEvent event)
{
super(foTree, FObjectNames.PAGE_SEQUENCE, parent, event,
FONode.PAGESEQ_SET, sparsePropsMap, sparseIndices);
- XMLEvent ev;
+ XmlEvent ev;
// Look for optional title
String nowProcessing = "title";
try {
ev = xmlevents.expectStartElement
- (FObjectNames.TITLE, XMLEvent.DISCARD_W_SPACE);
+ (FObjectNames.TITLE, XmlEvent.DISCARD_W_SPACE);
if (ev != null) {
// process the title
title = numChildren();
// Look for zero or more static-content
nowProcessing = "static-content";
while ((ev = xmlevents.expectStartElement
- (FObjectNames.STATIC_CONTENT, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.STATIC_CONTENT, XmlEvent.DISCARD_W_SPACE))
!= null) {
// Loop over remaining fo:static-content
if (firstStaticContent != -1)
// must have at least one
nowProcessing = "flow";
ev = xmlevents.expectStartElement
- (FObjectNames.FLOW, XMLEvent.DISCARD_W_SPACE);
+ (FObjectNames.FLOW, XmlEvent.DISCARD_W_SPACE);
if (ev == null)
throw new FOPException("No flow found.");
firstFlow = numChildren();
ev = xmlevents.getEndElement(SyncedXmlEventsBuffer.DISCARD_EV, ev);
namespaces.surrenderEvent(ev);
while ((ev = xmlevents.expectStartElement
- (FObjectNames.FLOW, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.FLOW, XmlEvent.DISCARD_W_SPACE))
!= null) {
// Loop over remaining fo:page-sequences
new FoFlow(getFOTree(), this, (FoXMLEvent)ev);
import org.apache.fop.fo.FObjectNames;
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.PropertySets;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
* Implements #PcdATA within page-sequence flow objects.
* specification.
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
*/
public FoPcdata
- (FOTree foTree, FONode parent, XMLEvent event, int stateFlags)
+ (FOTree foTree, FONode parent, XmlEvent event, int stateFlags)
throws TreeException, FOPException
{
super(foTree, FObjectNames.PCDATA, parent, event,
import org.apache.fop.fo.FObjects;
import org.apache.fop.fo.PropNames;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:static-content: (%block;)+
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
*/
public FoStaticContent(FOTree foTree, FONode parent, FoXMLEvent event)
{
super(foTree, FObjectNames.STATIC_CONTENT, parent, event,
FONode.STATIC_SET, sparsePropsMap, sparseIndices);
- XMLEvent ev;
+ XmlEvent ev;
try {
// Get at least one %block;
if ((ev = xmlevents.expectBlock()) == null)
import org.apache.fop.fo.PropertySets;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
/**
* (marker*, table-column*, table-header?, table-footer?, table-body+)
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.TABLE, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev;
+ XmlEvent ev;
// Look for zero or more markers
String nowProcessing = "marker";
try {
while ((ev = xmlevents.expectStartElement
- (FObjectNames.MARKER, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.MARKER, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoMarker(getFOTree(), this, (FoXMLEvent)ev, stateFlags);
numMarkers++;
// Look for zero or more table-columns
nowProcessing = "table-column";
while ((ev = xmlevents.expectStartElement
- (FObjectNames.TABLE_COLUMN, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.TABLE_COLUMN, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoTableColumn(
getFOTree(), this, (FoXMLEvent)ev, stateFlags);
// Look for optional table-header
nowProcessing = "table-header";
if ((ev = xmlevents.expectStartElement
- (FObjectNames.TABLE_HEADER, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.TABLE_HEADER, XmlEvent.DISCARD_W_SPACE))
!= null) {
headerOffset = numChildren();
new FoTableHeader(
// Look for optional table-footer
nowProcessing = "table-footer";
if ((ev = xmlevents.expectStartElement
- (FObjectNames.TABLE_FOOTER, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.TABLE_FOOTER, XmlEvent.DISCARD_W_SPACE))
!= null) {
footerOffset = numChildren();
new FoTableFooter(
// must have at least one
nowProcessing = "table-body";
ev = xmlevents.expectStartElement
- (FObjectNames.TABLE_BODY, XMLEvent.DISCARD_W_SPACE);
+ (FObjectNames.TABLE_BODY, XmlEvent.DISCARD_W_SPACE);
if (ev == null)
throw new FOPException("No table-body found.");
firstBodyOffset = numChildren();
ev = xmlevents.getEndElement(SyncedXmlEventsBuffer.DISCARD_EV, ev);
namespaces.surrenderEvent(ev);
while ((ev = xmlevents.expectStartElement
- (FObjectNames.TABLE_BODY, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.TABLE_BODY, XmlEvent.DISCARD_W_SPACE))
!= null) {
// Loop over remaining fo:table-body's
new FoTableBody(
import org.apache.fop.fo.PropertySets;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
/**
* (marker*, table-caption?, table)
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.TABLE_AND_CAPTION, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev;
+ XmlEvent ev;
// Look for zero or more markers
String nowProcessing = "marker";
try {
while ((ev = xmlevents.expectStartElement
- (FObjectNames.MARKER, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.MARKER, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoMarker(getFOTree(), this, (FoXMLEvent)ev, stateFlags);
numMarkers++;
// Look for optional table-caption
nowProcessing = "table-caption";
if ((ev = xmlevents.expectStartElement
- (FObjectNames.TABLE_CAPTION, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.TABLE_CAPTION, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoTableCaption(
getFOTree(), this, (FoXMLEvent)ev, stateFlags);
// Look for one table
nowProcessing = "table";
ev = xmlevents.expectStartElement
- (FObjectNames.TABLE, XMLEvent.DISCARD_W_SPACE);
+ (FObjectNames.TABLE, XmlEvent.DISCARD_W_SPACE);
if (ev == null)
throw new FOPException("No table found.");
tableOffset = numChildren();
import org.apache.fop.fo.PropertySets;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
/**
* (marker*, (table-row+|table-cell+))
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.TABLE_BODY, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev;
+ XmlEvent ev;
// Look for zero or more markers
String nowProcessing = "marker";
try {
while ((ev = xmlevents.expectStartElement
- (FObjectNames.MARKER, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.MARKER, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoMarker(getFOTree(), this, (FoXMLEvent)ev, stateFlags);
numMarkers++;
// Look for one or more table-rows
nowProcessing = "table-row";
while ((ev = xmlevents.expectStartElement
- (FObjectNames.TABLE_ROW, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.TABLE_ROW, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoTableRow(getFOTree(), this, (FoXMLEvent)ev, stateFlags);
numRows++;
// No rows - look for one or more table-cells
nowProcessing = "table-cell";
if ((ev = xmlevents.expectStartElement
- (FObjectNames.TABLE_CELL, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.TABLE_CELL, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoTableCell(
getFOTree(), this, (FoXMLEvent)ev, stateFlags);
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.PropertySets;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:table-caption (%block;)+
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.TABLE_CAPTION, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev = null;
+ XmlEvent ev = null;
try {
// Get at least one %block;
if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0)
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.PropertySets;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:table-cell: (marker*, %block;+)
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.TABLE_CELL, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev = null;
+ XmlEvent ev = null;
try {
// Get at least one %block;
if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0)
import org.apache.fop.fo.PropertySets;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
/**
* (marker*, (table-row+|table-cell+))
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.TABLE_FOOTER, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev;
+ XmlEvent ev;
// Look for zero or more markers
String nowProcessing = "marker";
try {
while ((ev = xmlevents.expectStartElement
- (FObjectNames.MARKER, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.MARKER, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoMarker(getFOTree(), this, (FoXMLEvent)ev, stateFlags);
numMarkers++;
// Look for one or more table-rows
nowProcessing = "table-row";
while ((ev = xmlevents.expectStartElement
- (FObjectNames.TABLE_ROW, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.TABLE_ROW, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoTableRow(getFOTree(), this, (FoXMLEvent)ev, stateFlags);
numRows++;
// No rows - look for one or more table-cells
nowProcessing = "table-cell";
if ((ev = xmlevents.expectStartElement
- (FObjectNames.TABLE_CELL, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.TABLE_CELL, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoTableCell(
getFOTree(), this, (FoXMLEvent)ev, stateFlags);
import org.apache.fop.fo.PropertySets;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
/**
* (marker*, (table-row+|table-cell+))
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.TABLE_HEADER, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev;
+ XmlEvent ev;
// Look for zero or more markers
String nowProcessing = "marker";
try {
while ((ev = xmlevents.expectStartElement
- (FObjectNames.MARKER, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.MARKER, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoMarker(getFOTree(), this, (FoXMLEvent)ev, stateFlags);
numMarkers++;
// Look for one or more table-rows
nowProcessing = "table-row";
while ((ev = xmlevents.expectStartElement
- (FObjectNames.TABLE_ROW, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.TABLE_ROW, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoTableRow(getFOTree(), this, (FoXMLEvent)ev, stateFlags);
numRows++;
// No rows - look for one or more table-cells
nowProcessing = "table-cell";
if ((ev = xmlevents.expectStartElement
- (FObjectNames.TABLE_CELL, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.TABLE_CELL, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoTableCell(
getFOTree(), this, (FoXMLEvent)ev, stateFlags);
import org.apache.fop.fo.PropertySets;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
/**
* <p>Content model for fo:table-row: (table-cell+)
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.TABLE_ROW, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev;
+ XmlEvent ev;
// Look for zero or more markers
String nowProcessing = "table-cell";
try {
nowProcessing = "table-cell";
if ((ev = xmlevents.expectStartElement
- (FObjectNames.TABLE_CELL, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.TABLE_CELL, XmlEvent.DISCARD_W_SPACE))
!= null) {
new FoTableCell(
getFOTree(), this, (FoXMLEvent)ev, stateFlags);
import org.apache.fop.fo.PropertySets;
import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:title: (#PCDATA|%inline;)*
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
*/
public FoTitle(FOTree foTree, FONode parent, FoXMLEvent event)
{
super(foTree, FObjectNames.TITLE, parent, event,
FONode.TITLE_SET, sparsePropsMap, sparseIndices);
- XMLEvent ev = null;
+ XmlEvent ev = null;
do {
try {
ev = xmlevents.expectOutOfLinePcdataOrInline();
// Generate the flow object
FObjects.fobjects.makeFlowObject(
foTree, this, ev, FONode.TITLE_SET);
- if (ev.getType() != XMLEvent.CHARACTERS)
+ if (ev.getType() != XmlEvent.CHARACTERS)
ev = xmlevents.getEndElement(
SyncedXmlEventsBuffer.DISCARD_EV, ev);
namespaces.surrenderEvent(ev);
import org.apache.fop.fo.PropNames;
import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.xml.FoXMLEvent;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
import org.apache.fop.xml.UnexpectedStartElementException;
* <p>Content model for fo:inline: (marker*,(#PCDATA|%inline;|%wrapper;)*)
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
* @param stateFlags - passed down from the parent. Includes the
* attribute set information.
{
super(foTree, FObjectNames.WRAPPER, parent, event,
stateFlags, sparsePropsMap, sparseIndices);
- XMLEvent ev = null;
+ XmlEvent ev = null;
do {
try {
if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0)
//System.out.println("Generating flow object for " + ev);
FObjects.fobjects.makeFlowObject(
foTree, this, ev, stateFlags);
- if (ev.getType() != XMLEvent.CHARACTERS)
+ if (ev.getType() != XmlEvent.CHARACTERS)
ev = xmlevents.getEndElement(
SyncedXmlEventsBuffer.DISCARD_EV, ev);
namespaces.surrenderEvent(ev);
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
* <tt>FoLayoutMasterSet</tt> is the class which processes the
/**
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
*/
public FoLayoutMasterSet
- (FOTree foTree, FONode parent, XMLEvent event)
+ (FOTree foTree, FONode parent, XmlEvent event)
throws TreeException, FOPException, PropertyException
{
super(foTree, FObjectNames.LAYOUT_MASTER_SET, parent, event,
* @param event - the layout page-master-set STARTELEMENT event.
* @throws FOPException
*/
- public void setupPageMasters(XMLEvent event)
+ public void setupPageMasters(XmlEvent event)
throws FOPException, PropertyException
{
FoSimplePageMaster simple;
FoPageSequenceMaster foPageSeq;
try {
do {
- XMLEvent ev =
+ XmlEvent ev =
xmlevents.expectStartElement
- (simpleOrSequenceMaster, XMLEvent.DISCARD_W_SPACE);
+ (simpleOrSequenceMaster, XmlEvent.DISCARD_W_SPACE);
if (ev == null) break; // No instance of these elements found
foType = ev.getFoType();
if (foType == FObjectNames.SIMPLE_PAGE_MASTER) {
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
* Implements the fo:page-sequence-master flow object. These Fos are
FObjectNames.REPEATABLE_PAGE_MASTER_ALTERNATIVES
};
- public FoPageSequenceMaster(FOTree foTree, FONode parent, XMLEvent event)
+ public FoPageSequenceMaster(FOTree foTree, FONode parent, XmlEvent event)
throws TreeException, FOPException, PropertyException
{
super(foTree, FObjectNames.PAGE_SEQUENCE_MASTER, parent, event,
// Process sequence members here
try {
do {
- XMLEvent ev = xmlevents.expectStartElement
- (singleOrRepeatableMasterRefs, XMLEvent.DISCARD_W_SPACE);
+ XmlEvent ev = xmlevents.expectStartElement
+ (singleOrRepeatableMasterRefs, XmlEvent.DISCARD_W_SPACE);
if (ev == null) break; // page-sequence-masters exhausted
int foType = ev.getFoType();
if (foType == FObjectNames.SINGLE_PAGE_MASTER_REFERENCE) {
public class FoSinglePageMasterReference extends FONode {
public FoSinglePageMasterReference
- (FOTree foTree, FONode parent, XMLEvent event)
+ (FOTree foTree, FONode parent, XmlEvent event)
throws TreeException, FOPException, PropertyException
{
super(foTree, FObjectNames.SINGLE_PAGE_MASTER_REFERENCE, parent,
public class FoRepeatablePageMasterReference extends FONode {
public FoRepeatablePageMasterReference
- (FOTree foTree, FONode parent, XMLEvent event)
+ (FOTree foTree, FONode parent, XmlEvent event)
throws TreeException, FOPException, PropertyException
{
super(foTree, FObjectNames.REPEATABLE_PAGE_MASTER_REFERENCE,
public class FoRepeatablePageMasterAlternatives extends FONode {
public FoRepeatablePageMasterAlternatives
- (FOTree foTree, FONode parent, XMLEvent event)
+ (FOTree foTree, FONode parent, XmlEvent event)
throws TreeException, FOPException, PropertyException
{
super(foTree, FObjectNames.REPEATABLE_PAGE_MASTER_ALTERNATIVES,
// Process conditional-page-master-references here
try {
do {
- XMLEvent ev = this.xmlevents.expectStartElement
+ XmlEvent ev = this.xmlevents.expectStartElement
(FObjectNames.CONDITIONAL_PAGE_MASTER_REFERENCE,
- XMLEvent.DISCARD_W_SPACE);
+ XmlEvent.DISCARD_W_SPACE);
if (ev == null) break; // Sub-sequences exhausted
//System.out.println
// ("Found conditional-page-master-reference");
public class FoConditionalPageMasterReference extends FONode {
public FoConditionalPageMasterReference
- (FOTree foTree, FONode parent, XMLEvent event)
+ (FOTree foTree, FONode parent, XmlEvent event)
throws TreeException, FOPException, PropertyException
{
super(foTree, FObjectNames.CONDITIONAL_PAGE_MASTER_REFERENCE,
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOTree;
import org.apache.fop.fo.FObjectNames;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
* Implements the fo:simple-page-master flow object
/**
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
*/
- public FoRegionAfter(FOTree foTree, FONode parent, XMLEvent event)
+ public FoRegionAfter(FOTree foTree, FONode parent, XmlEvent event)
throws TreeException, FOPException
{
super(foTree, FObjectNames.REGION_AFTER, parent, event);
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOTree;
import org.apache.fop.fo.FObjectNames;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
* Implements the fo:simple-page-master flow object
/**
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
*/
- public FoRegionBefore(FOTree foTree, FONode parent, XMLEvent event)
+ public FoRegionBefore(FOTree foTree, FONode parent, XmlEvent event)
throws TreeException, FOPException
{
super(foTree, FObjectNames.REGION_BEFORE, parent, event);
import org.apache.fop.fo.FOTree;
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.PropertySets;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
* Implements the fo:simple-page-master flow object
/**
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
*/
public FoRegionBeforeAfter
- (FOTree foTree, int foType, FONode parent, XMLEvent event)
+ (FOTree foTree, int foType, FONode parent, XmlEvent event)
throws TreeException, FOPException
{
super(foTree, foType, parent, event, FONode.LAYOUT_SET,
import org.apache.fop.fo.FObjectNames;
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.PropertySets;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
* Implements the fo:simple-page-master flow object
* @param event the <tt>FoXMLEvent</tt> that triggered the creation of
* this node
*/
- public FoRegionBody(FOTree foTree, FONode parent, XMLEvent event)
+ public FoRegionBody(FOTree foTree, FONode parent, XmlEvent event)
throws TreeException, FOPException
{
super(foTree, FObjectNames.REGION_BODY, parent, event,
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOTree;
import org.apache.fop.fo.FObjectNames;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
/**
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
*/
- public FoRegionEnd(FOTree foTree, FONode parent, XMLEvent event)
+ public FoRegionEnd(FOTree foTree, FONode parent, XmlEvent event)
throws TreeException, FOPException
{
super(foTree, FObjectNames.REGION_END, parent, event);
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOTree;
import org.apache.fop.fo.FObjectNames;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
* Implements the fo:simple-page-master flow object
/**
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
*/
- public FoRegionStart(FOTree foTree, FONode parent, XMLEvent event)
+ public FoRegionStart(FOTree foTree, FONode parent, XmlEvent event)
throws TreeException, FOPException
{
super(foTree, FObjectNames.REGION_START, parent, event);
import org.apache.fop.fo.FOTree;
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.PropertySets;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
* Implements the fo:simple-page-master flow object
/**
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
*/
public FoRegionStartEnd
- (FOTree foTree, int foType, FONode parent, XMLEvent event)
+ (FOTree foTree, int foType, FONode parent, XmlEvent event)
throws TreeException, FOPException
{
super(foTree, foType, parent, event, FONode.LAYOUT_SET,
import org.apache.fop.fo.PropertySets;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.SyncedXmlEventsBuffer;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
* Implements the fo:simple-page-master flow object
/**
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
- * @param event the <tt>XMLEvent</tt> that triggered the creation of
+ * @param event the <tt>XmlEvent</tt> that triggered the creation of
* this node
*/
- public FoSimplePageMaster(FOTree foTree, FONode parent, XMLEvent event)
+ public FoSimplePageMaster(FOTree foTree, FONode parent, XmlEvent event)
throws TreeException, FOPException
{
super(foTree, FObjectNames.SIMPLE_PAGE_MASTER, parent, event,
FONode.LAYOUT_SET, sparsePropsMap, sparseIndices);
// Process regions here
- XMLEvent regionEv;
+ XmlEvent regionEv;
if ((regionEv = xmlevents.expectStartElement
- (FObjectNames.REGION_BODY, XMLEvent.DISCARD_W_SPACE)) == null)
+ (FObjectNames.REGION_BODY, XmlEvent.DISCARD_W_SPACE)) == null)
throw new FOPException
("No fo:region-body in simple-page-master: "
+ getMasterName());
// Remaining regions are optional
if ((regionEv = xmlevents.expectStartElement
- (FObjectNames.REGION_BEFORE, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.REGION_BEFORE, XmlEvent.DISCARD_W_SPACE))
!= null)
{
regionBefore = new FoRegionBefore(foTree, this, regionEv);
}
if ((regionEv = xmlevents.expectStartElement
- (FObjectNames.REGION_AFTER, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.REGION_AFTER, XmlEvent.DISCARD_W_SPACE))
!= null)
{
regionAfter = new FoRegionAfter(foTree, this, regionEv);
}
if ((regionEv = xmlevents.expectStartElement
- (FObjectNames.REGION_START, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.REGION_START, XmlEvent.DISCARD_W_SPACE))
!= null)
{
regionStart = new FoRegionStart(foTree, this, regionEv);
}
if ((regionEv = xmlevents.expectStartElement
- (FObjectNames.REGION_END, XMLEvent.DISCARD_W_SPACE))
+ (FObjectNames.REGION_END, XmlEvent.DISCARD_W_SPACE))
!= null)
{
regionEnd = new FoRegionEnd(foTree, this, regionEv);
*/
package org.apache.fop.pool;
-import org.apache.fop.xml.XMLEvent;
+import org.apache.fop.xml.XmlEvent;
/**
- * This class provides a pool of <tt>XMLEvent</tt> objects.
+ * This class provides a pool of <tt>XmlEvent</tt> objects.
*/
public class XMLEventPool extends FopPool {
private static final String tag = "$Name$";
private static final String revision = "$Revision$";
- /** Required argument for constructing new <tt>XMLEvent</tt>s. */
+ /** Required argument for constructing new <tt>XmlEvent</tt>s. */
//protected final Namespaces namespaces;
/**
* The zero-argument constructor
}
/**
- * Acquire an <tt>XMLEvent</tt>.
- * @return an <tt>XMLEvent</tt>.
+ * Acquire an <tt>XmlEvent</tt>.
+ * @return an <tt>XmlEvent</tt>.
*/
- public synchronized XMLEvent acquireXMLEvent() {
- return (XMLEvent)acquirePoolable();
+ public synchronized XmlEvent acquireXMLEvent() {
+ return (XmlEvent)acquirePoolable();
}
}
* The <tt>XMLSerialHandler</tt> methods set the values directly.
*/
-public class FoXMLEvent extends XMLEvent {
+public class FoXMLEvent extends XmlEvent {
private static final String tag = "$Name$";
private static final String revision = "$Revision$";
/**
* Clear the fields of this event. Provided for pool operations.
* Neither the <i>namespaces</i> nor the <i>id</i> field is cleared.
- * @return the cleared <tt>XMLEvent</tt> event.
+ * @return the cleared <tt>XmlEvent</tt> event.
*/
public Poolable clear() {
foType = FObjectNames.NO_FO;
/**
* Clear the fields of this event. Provided for pool operations.
* Neither the <i>namespaces</i> nor the <i>id</i> field is cleared.
- * @return the cleared <tt>XMLEvent</tt> event.
+ * @return the cleared <tt>XmlEvent</tt> event.
*/
public FoXMLEvent clearFo() {
return (FoXMLEvent)clear();
* Provided for pool operations.
* Neither the <i>namespaces</i> nor the <i>id</i> field is copied.
* The <i>namespaces</i> field is not cleared.
- * @param ev the <tt>XMLEvent</tt> to copy.
- * @return the copied <tt>XMLEvent</tt> event.
+ * @param ev the <tt>XmlEvent</tt> to copy.
+ * @return the copied <tt>XmlEvent</tt> event.
*/
- public XMLEvent copyEvent(FoXMLEvent ev) {
+ public XmlEvent copyEvent(FoXMLEvent ev) {
foType = ev.foType;
return super.copyEvent(ev);
}
* Provided for pool operations.
* Neither the <i>namespaces</i> nor the <i>id</i> field is copied.
* The <i>namespaces</i> field is not cleared.
- * @return the copied <tt>XMLEvent</tt> event.
+ * @return the copied <tt>XmlEvent</tt> event.
*/
public FoXMLEvent copyFoEvent(FoXMLEvent ev) {
return (FoXMLEvent)copyEvent(ev);
* <tt>InterruptedException</tt> that is possible from the <i>put</i>
* method of a <tt>SyncedXmlEventsBuffer</tt>.
*/
- public void putEvent(XMLEvent event) throws NoSuchElementException {
+ public void putEvent(XmlEvent event) throws NoSuchElementException {
synchronized (events) {
try {
events.put(event);
*/
public void startDocument() throws NoSuchElementException {
synchronized (events) {
- XMLEvent event = acquireXMLEvent(Namespaces.DefAttrNSIndex);
+ XmlEvent event = acquireXMLEvent(Namespaces.DefAttrNSIndex);
//System.out.println("StartDocument thread "
// + Thread.currentThread().getName());
- event.type = XMLEvent.STARTDOCUMENT;
+ event.type = XmlEvent.STARTDOCUMENT;
//System.out.println("SerialHandler: " + event);
putEvent(event);
}
*/
public void endDocument() throws NoSuchElementException {
synchronized (events) {
- XMLEvent event = acquireXMLEvent(Namespaces.DefAttrNSIndex);
+ XmlEvent event = acquireXMLEvent(Namespaces.DefAttrNSIndex);
//System.out.println("EndDocument thread "
//+ Thread.currentThread().getName());
- event.type = XMLEvent.ENDDOCUMENT;
+ event.type = XmlEvent.ENDDOCUMENT;
//System.out.println("SerialHandler: " + event);
putEvent(event);
events.producerExhausted();
* @param nsIndex the namespace index
* @return the acquired event
*/
- private XMLEvent acquireXMLEvent(int nsIndex) {
+ private XmlEvent acquireXMLEvent(int nsIndex) {
try {
return
namespaces.acquireXMLEvent(nsIndex);
synchronized (events) {
try {
int uriIndex = namespaces.getURIIndex(uri);
- XMLEvent event = acquireXMLEvent(uriIndex);
+ XmlEvent event = acquireXMLEvent(uriIndex);
if (uriIndex == Namespaces.XSLNSpaceIndex) {
event.setFoType(FObjectNames.getFOIndex(localName));
}
//System.out.println("startElement: acquired " + event.id);
//System.out.println("StartElement thread "
// + Thread.currentThread().getName());
- event.type = XMLEvent.STARTELEMENT;
+ event.type = XmlEvent.STARTELEMENT;
// Is this from the fo: namespace?
event.uriIndex = uriIndex;
event.localName = localName;
synchronized (events) {
try {
int uriIndex = namespaces.getURIIndex(uri);
- XMLEvent event = namespaces.acquireXMLEvent(uriIndex);
+ XmlEvent event = namespaces.acquireXMLEvent(uriIndex);
//System.out.println("endElement: acquired " + event.id);
//System.out.println("EndElement thread "
//+ Thread.currentThread().getName());
- event.type = XMLEvent.ENDELEMENT;
+ event.type = XmlEvent.ENDELEMENT;
event.uriIndex = uriIndex;
if (uriIndex == Namespaces.XSLNSpaceIndex) {
event.setFoType(FObjectNames.getFOIndex(localName));
// attribute namespace (the empty string), and rely on
// downstream processing to determine the environment in
// which the characters belong.
- XMLEvent event
+ XmlEvent event
= namespaces.acquireXMLEvent(Namespaces.DefAttrNSIndex);
//System.out.println("characters thread "
// + Thread.currentThread().getName());
- event.type = XMLEvent.CHARACTERS;
+ event.type = XmlEvent.CHARACTERS;
event.chars = new String(ch, start, length);
- // Can't setFoType, because this event is now an XMLEvent,
+ // Can't setFoType, because this event is now an XmlEvent,
// not an FoXMLEvent
//event.setFoType(FObjectNames.PCDATA);
//System.out.println("SerialHandler: " + event);
* <tt>XMLSerialHandler</tt>.
* One instance of <i>Namespaces</i> is maintained across all documents
* that may be processed in a single invocation of <tt>XMLSerialhandler</tt>.
- * A reference to that instance is kept with every instance of <tt>XMLEvent</tt>.
+ * A reference to that instance is kept with every instance of <tt>XmlEvent</tt>.
* An <code>XMLEventPool</code> pool of event objects is maintained for every
* namesapce encountered in parsing. The pool for the
* http://www.w3.org/1999/XSL/Format (XSL_FO) namespace is created immediately;
private UriLocalNamePool uriLocalNamePool;
/**
- * Sequenced objects for use by <tt>XMLEvent</tt>s. Because an
- * <tt>XMLEvent</tt> object must always be associated with an
+ * Sequenced objects for use by <tt>XmlEvent</tt>s. Because an
+ * <tt>XmlEvent</tt> object must always be associated with an
* <i>XMLNamespace</i> object, this namespace object will act as a
- * singleton for <tt>XMLEvent</tt>s. This field provides a counter for
+ * singleton for <tt>XmlEvent</tt>s. This field provides a counter for
* those objects. The range of values which may be assigned to
* <i>nsSequences</i> is restricted by <i>nsSeqMasks</i>.
*/
}
/**
- * Generate a new XMLEvent, based on the uriIndex argument. The uriIndex
+ * Generate a new XmlEvent, based on the uriIndex argument. The uriIndex
* must be valid for this Namespaces object; i.e. it must correspond to
* a namespace being tracked in this object.
*
* @param nsIndex
* the namespace index
- * @return an appropriate <code>XMLEvent</code>
+ * @return an appropriate <code>XmlEvent</code>
*/
- public XMLEvent makeXMLEvent(int nsIndex) throws FOPException {
+ public XmlEvent makeXMLEvent(int nsIndex) throws FOPException {
if (nsIndex < 0 | nsIndex >= (uris.length)) {
throw new FOPException("URI index out or range");
}
}
/**
- * Generate a new XMLEvent, based on the uriIndex argument. This
+ * Generate a new XmlEvent, based on the uriIndex argument. This
* private method is for interanl use when the <code>nsIndex</code> is
* known to be in range.
*
* @param nsIndex
* the namespace index
- * @return an appropriate <code>XMLEvent</code>
+ * @return an appropriate <code>XmlEvent</code>
*/
- private XMLEvent newXMLEvent(int nsIndex) {
- // The only currently known subclass of XMLEvent is FoXMLEvent
+ private XmlEvent newXMLEvent(int nsIndex) {
+ // The only currently known subclass of XmlEvent is FoXMLEvent
switch (nsIndex) {
case DefAttrNSIndex :
- // Produce an XMLEvent, e.g. for START_DOCUMENT and, more
+ // Produce an XmlEvent, e.g. for START_DOCUMENT and, more
// importantly, CHARACTERS.
synchronized (nsSequences) {
nsSequences[nsIndex] =
++nsSequences[nsIndex] & nsSeqMasks[nsIndex];
- return new XMLEvent(this, nsSequences[nsIndex], nsIndex);
+ return new XmlEvent(this, nsSequences[nsIndex], nsIndex);
}
case XSLNSpaceIndex :
// Make an FoXMLEvent
case SVGNSpaceIndex :
// No SvgXMLEvent defined - don't break, but fall through
default :
- // Just produce a raw XMLEvent
+ // Just produce a raw XmlEvent
synchronized (nsSequences) {
nsSequences[nsIndex] =
++nsSequences[nsIndex] & nsSeqMasks[nsIndex];
- return new XMLEvent(this, nsSequences[nsIndex], nsIndex);
+ return new XmlEvent(this, nsSequences[nsIndex], nsIndex);
}
}
}
/**
* Acquire an event.
*
- * @return an <tt>XMLEvent</tt>.
+ * @return an <tt>XmlEvent</tt>.
*/
- public XMLEvent acquireXMLEvent(int nsIndex) throws FOPException {
+ public XmlEvent acquireXMLEvent(int nsIndex) throws FOPException {
if (nsIndex < 0 || nsIndex > uris.length) {
throw new FOPException("URI index out of range: " + nsIndex);
}
- XMLEvent ev;
+ XmlEvent ev;
if ((ev = pools[nsIndex].acquireXMLEvent()) != null) {
return ev;
}
* the pool.
* @param event to surrender
*/
- public void surrenderEvent(XMLEvent event) {
+ public void surrenderEvent(XmlEvent event) {
pools[event.uriIndex].surrenderPoolable(event);
}
/**
* Constant for <i>discardEvent</i> field of
- * <i>getEndElement(boolean discardEvent, XMLEvent(, boolean)).
+ * <i>getEndElement(boolean discardEvent, XmlEvent(, boolean)).
*/
public static final boolean DISCARD_EV = true,
RETAIN_EV = false;
* any InterruptedException exceptions thrown by the
* <tt>SyncedCircularBuffer</tt> are transformed
*/
- public XMLEvent getEvent() throws FOPException {
- XMLEvent ev;
+ public XmlEvent getEvent() throws FOPException {
+ XmlEvent ev;
try {
- ev = (XMLEvent)get();
+ ev = (XmlEvent)get();
//System.out.println("getEvent: " + ev);
return ev;
} catch (InterruptedException e) {
* @exception FOPException if buffer errors or interrupts occur.
* @exception NoSuchElementException if the event is not found.
*/
- public XMLEvent getSaxEvent(int eventType) throws FOPException {
- XMLEvent ev = getEvent();
+ public XmlEvent getSaxEvent(int eventType) throws FOPException {
+ XmlEvent ev = getEvent();
while (ev != null && ev.type != eventType) {
ev = getEvent();
}
if (ev == null) {
throw new NoSuchElementException
- (XMLEvent.eventTypeName(eventType) + " not found.");
+ (XmlEvent.eventTypeName(eventType) + " not found.");
}
return ev;
}
* @exception FOPException if buffer errors or interrupts occur.
* @exception NoSuchElementException if the event is not found.
*/
- public XMLEvent getSaxQNameEvent(int eventType, String qName)
+ public XmlEvent getSaxQNameEvent(int eventType, String qName)
throws FOPException
{
- XMLEvent ev = getEvent();
+ XmlEvent ev = getEvent();
while (ev != null &&
! (ev.type == eventType && ev.qName.equals(qName))) {
ev = getEvent();
}
if (ev == null) {
throw new NoSuchElementException
- (XMLEvent.eventTypeName(eventType) + " " + qName + " not found.");
+ (XmlEvent.eventTypeName(eventType) + " " + qName + " not found.");
}
return ev;
}
* @exception FOPException if buffer errors or interrupts occur.
* @exception NoSuchElementException if the event is not found.
*/
- public XMLEvent getSaxUriLocalEvent
+ public XmlEvent getSaxUriLocalEvent
(int eventType, int uriIndex, String localName)
throws FOPException
{
- XMLEvent ev = getEvent();
+ XmlEvent ev = getEvent();
while (ev != null &&
! (ev.type == eventType
&& ev.uriIndex == uriIndex
}
if (ev == null)
throw new NoSuchElementException
- (XMLEvent.eventTypeName(eventType)
+ (XmlEvent.eventTypeName(eventType)
+ namespaces.getIndexURI(uriIndex)
+ ":" + localName + " not found.");
return ev;
* @return the matching event
* @throws FOPException
*/
- public XMLEvent getSaxUriTypedEvent(
+ public XmlEvent getSaxUriTypedEvent(
int eventType, int uriIndex, int nsType) throws FOPException {
- XMLEvent ev = getEvent();
+ XmlEvent ev = getEvent();
while (ev != null) {
if (ev.type == eventType && ev.uriIndex == uriIndex) {
switch (uriIndex) {
ev = getEvent();
}
throw new NoSuchElementException
- (XMLEvent.eventTypeName(eventType) + " "
+ (XmlEvent.eventTypeName(eventType) + " "
+ namespaces.getIndexURI(uriIndex)
+ " type " + nsType + " not found.");
}
* @exception FOPException if buffer errors or interrupts occur.
* @exception NoSuchElementException if the event is not found.
*/
- public XMLEvent getSaxFoEvent(int eventType, int foType)
+ public XmlEvent getSaxFoEvent(int eventType, int foType)
throws FOPException
{
return getSaxUriTypedEvent(
* @exception FOPException if buffer errors or interrupts occur.
* @exception NoSuchElementException if the buffer is empty.
*/
- public XMLEvent expectSaxEvent
+ public XmlEvent expectSaxEvent
(int eventType, boolean discardWhiteSpace)
throws FOPException
{
- XMLEvent ev = getEvent();
+ XmlEvent ev = getEvent();
if (discardWhiteSpace) {
- while (ev != null && ev.type == XMLEvent.CHARACTERS
+ while (ev != null && ev.type == XmlEvent.CHARACTERS
&& ev.chars.trim().equals("")) {
namespaces.surrenderEvent(ev);
ev = getEvent();
}
if (ev == null)
throw new NoSuchElementException
- (XMLEvent.eventTypeName(eventType)
+ (XmlEvent.eventTypeName(eventType)
+ " not found: end of buffer.");
pushBack(ev);
return null;
* @exception NoSuchElementException if the event is not found.
*/
/*
- public XMLEvent expectSaxQNameEvent
+ public XmlEvent expectSaxQNameEvent
(int eventType, String qName, boolean discardWhiteSpace)
throws FOPException
{
- XMLEvent ev = getEvent();
+ XmlEvent ev = getEvent();
if (discardWhiteSpace) {
- while (ev != null && ev.type == XMLEvent.CHARACTERS
+ while (ev != null && ev.type == XmlEvent.CHARACTERS
&& ev.chars.trim().equals("")) {
namespaces.surrenderEvent(ev);
ev = getEvent();
}
if (ev == null)
throw new NoSuchElementException
- (XMLEvent.eventTypeName(eventType)
+ (XmlEvent.eventTypeName(eventType)
+ " not found: end of buffer.");
pushBack(ev);
return null;
* @exception FOPException if buffer errors or interrupts occur.
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectSaxUriLocalEvent
+ public XmlEvent expectSaxUriLocalEvent
(int eventType, int uriIndex,
String localName, boolean discardWhiteSpace)
throws FOPException
{
- XMLEvent ev = getEvent();
+ XmlEvent ev = getEvent();
if (discardWhiteSpace) {
- while (ev != null && ev.type == XMLEvent.CHARACTERS
+ while (ev != null && ev.type == XmlEvent.CHARACTERS
&& ev.chars.trim().equals("")) {
namespaces.surrenderEvent(ev);
ev = getEvent();
}
if (ev == null)
throw new NoSuchElementException
- (XMLEvent.eventTypeName(eventType)
+ (XmlEvent.eventTypeName(eventType)
+ " not found: end of buffer.");
pushBack(ev);
return null;
* The erroneous event is pushed back.
* @throws FOPException
*/
- public XMLEvent expectSaxUriTypedEvent(
+ public XmlEvent expectSaxUriTypedEvent(
int eventType, int uriIndex, int nsType,
boolean discardWhiteSpace)
throws FOPException {
- XMLEvent ev = getEvent();
+ XmlEvent ev = getEvent();
if (discardWhiteSpace) {
- while (ev != null && ev.type == XMLEvent.CHARACTERS
+ while (ev != null && ev.type == XmlEvent.CHARACTERS
&& ev.chars.trim().equals("")) {
namespaces.surrenderEvent(ev);
ev = getEvent();
}
if (ev == null)
throw new NoSuchElementException
- (XMLEvent.eventTypeName(eventType) + " "
+ (XmlEvent.eventTypeName(eventType) + " "
+ namespaces.getIndexURI(uriIndex)
+ " type " + nsType + " not found.");
pushBack(ev);
* @exception FOPException if buffer errors or interrupts occur.
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectSaxFoEvent
+ public XmlEvent expectSaxFoEvent
(int eventType, int foType, boolean discardWhiteSpace)
throws FOPException
{
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getEndDocument() throws FOPException {
- return getSaxEvent(XMLEvent.ENDDOCUMENT);
+ public XmlEvent getEndDocument() throws FOPException {
+ return getSaxEvent(XmlEvent.ENDDOCUMENT);
}
/**
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectEndDocument(boolean discardWhiteSpace)
+ public XmlEvent expectEndDocument(boolean discardWhiteSpace)
throws FOPException
{
- return expectSaxEvent(XMLEvent.ENDDOCUMENT, discardWhiteSpace);
+ return expectSaxEvent(XmlEvent.ENDDOCUMENT, discardWhiteSpace);
}
/**
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getStartElement() throws FOPException {
- return getSaxEvent(XMLEvent.STARTELEMENT);
+ public XmlEvent getStartElement() throws FOPException {
+ return getSaxEvent(XmlEvent.STARTELEMENT);
}
/**
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectStartElement(boolean discardWhiteSpace)
+ public XmlEvent expectStartElement(boolean discardWhiteSpace)
throws FOPException
{
- return expectSaxEvent(XMLEvent.STARTELEMENT, discardWhiteSpace);
+ return expectSaxEvent(XmlEvent.STARTELEMENT, discardWhiteSpace);
}
/**
* @exception NoSuchElementException if the event is not found
*/
/*
- public XMLEvent getStartElement(String qName) throws FOPException
+ public XmlEvent getStartElement(String qName) throws FOPException
{
- return getSaxQNameEvent(XMLEvent.STARTELEMENT, qName);
+ return getSaxQNameEvent(XmlEvent.STARTELEMENT, qName);
}
*/
* @exception NoSuchElementException if end of buffer detected.
*/
/*
- public XMLEvent expectStartElement
+ public XmlEvent expectStartElement
(String qName, boolean discardWhiteSpace)
throws FOPException
{
return expectSaxQNameEvent
- (XMLEvent.STARTELEMENT, qName, discardWhiteSpace);
+ (XmlEvent.STARTELEMENT, qName, discardWhiteSpace);
}
*/
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getStartElement(int uriIndex, String localName)
+ public XmlEvent getStartElement(int uriIndex, String localName)
throws FOPException
{
- return getSaxUriLocalEvent(XMLEvent.STARTELEMENT, uriIndex, localName);
+ return getSaxUriLocalEvent(XmlEvent.STARTELEMENT, uriIndex, localName);
}
/**
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectStartElement
+ public XmlEvent expectStartElement
(int uriIndex, String localName, boolean discardWhiteSpace)
throws FOPException
{
return expectSaxUriLocalEvent
- (XMLEvent.STARTELEMENT, uriIndex, localName, discardWhiteSpace);
+ (XmlEvent.STARTELEMENT, uriIndex, localName, discardWhiteSpace);
}
/**
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getStartElement(int uriIndex, int nsType)
+ public XmlEvent getStartElement(int uriIndex, int nsType)
throws FOPException
{
- return getSaxUriTypedEvent(XMLEvent.STARTELEMENT, uriIndex, nsType);
+ return getSaxUriTypedEvent(XmlEvent.STARTELEMENT, uriIndex, nsType);
}
/**
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectStartElement(
+ public XmlEvent expectStartElement(
int uriIndex, int nsType, boolean discardWhiteSpace)
throws FOPException
{
return expectSaxUriTypedEvent(
- XMLEvent.STARTELEMENT, uriIndex, nsType, discardWhiteSpace);
+ XmlEvent.STARTELEMENT, uriIndex, nsType, discardWhiteSpace);
}
/**
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getStartElement(int foType)
+ public XmlEvent getStartElement(int foType)
throws FOPException
{
- return getSaxFoEvent(XMLEvent.STARTELEMENT, foType);
+ return getSaxFoEvent(XmlEvent.STARTELEMENT, foType);
}
/**
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectStartElement
+ public XmlEvent expectStartElement
(int foType, boolean discardWhiteSpace)
throws FOPException
{
return expectSaxFoEvent(
- XMLEvent.STARTELEMENT, foType, discardWhiteSpace);
+ XmlEvent.STARTELEMENT, foType, discardWhiteSpace);
}
/**
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getStartElement
+ public XmlEvent getStartElement
(LinkedList list, boolean discardWhiteSpace)
throws FOPException
{
- XMLEvent ev;
+ XmlEvent ev;
do {
ev = expectStartElement(list, discardWhiteSpace);
if (ev != null) return ev;
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectStartElement
+ public XmlEvent expectStartElement
(LinkedList list, boolean discardWhiteSpace)
throws FOPException
{
- XMLEvent ev;
+ XmlEvent ev;
Iterator elements = list.iterator();
while (elements.hasNext()) {
Object o = elements.next();
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getStartElement
+ public XmlEvent getStartElement
(UriLocalName[] list, boolean discardWhiteSpace)
throws FOPException
{
- XMLEvent ev;
+ XmlEvent ev;
do {
ev = expectStartElement(list, discardWhiteSpace);
if (ev != null) return ev;
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectStartElement
+ public XmlEvent expectStartElement
(UriLocalName[] list, boolean discardWhiteSpace)
throws FOPException
{
- XMLEvent ev;
+ XmlEvent ev;
for (int i = 0; i < list.length; i++) {
ev = expectStartElement(list[i].uriIndex,
list[i].localName,
* @exception NoSuchElementException if the event is not found
*/
/*
- public XMLEvent getStartElement(String[] list, boolean discardWhiteSpace)
+ public XmlEvent getStartElement(String[] list, boolean discardWhiteSpace)
throws FOPException
{
- XMLEvent ev;
+ XmlEvent ev;
do {
ev = expectStartElement(list, discardWhiteSpace);
if (ev != null) return ev;
* @exception NoSuchElementException if end of buffer detected.
*/
/*
- public XMLEvent expectStartElement
+ public XmlEvent expectStartElement
(String[] list, boolean discardWhiteSpace)
throws FOPException
{
- XMLEvent ev;
+ XmlEvent ev;
for (int i = 0; i < list.length; i++) {
ev = expectStartElement(list[i], discardWhiteSpace);
// Found it!
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getStartElement(int[] list, boolean discardWhiteSpace)
+ public XmlEvent getStartElement(int[] list, boolean discardWhiteSpace)
throws FOPException
{
- XMLEvent ev;
+ XmlEvent ev;
do {
ev = expectStartElement(list, discardWhiteSpace);
if (ev != null) return ev;
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectStartElement
+ public XmlEvent expectStartElement
(int[] list, boolean discardWhiteSpace)
throws FOPException
{
- XMLEvent ev;
+ XmlEvent ev;
for (int i = 0; i < list.length; i++) {
ev = expectStartElement(list[i], discardWhiteSpace);
// Found it!
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getStartElement(BitSet set, boolean discardWhiteSpace)
+ public XmlEvent getStartElement(BitSet set, boolean discardWhiteSpace)
throws FOPException
{
- XMLEvent ev;
+ XmlEvent ev;
do {
try {
ev = expectStartElement(set, discardWhiteSpace);
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectStartElement
+ public XmlEvent expectStartElement
(BitSet set, boolean discardWhiteSpace)
throws FOPException, UnexpectedStartElementException
{
- XMLEvent ev;
- ev = expectSaxEvent(XMLEvent.STARTELEMENT, discardWhiteSpace);
+ XmlEvent ev;
+ ev = expectSaxEvent(XmlEvent.STARTELEMENT, discardWhiteSpace);
if (ev == null) return ev;
for (int i = set.nextSetBit(0); i >= 0; i = set.nextSetBit(++i)) {
* <b>6.2 Formatting Object Content</b>, including out-of-line flow
* objects which may occur except as descendents of out-of-line formatting
* objects. White space is discarded.
- * @return the <tt>XMLEvent found. If any other events are encountered
+ * @return the <tt>XmlEvent found. If any other events are encountered
* return <tt>null</tt>.
*/
- public XMLEvent expectBlock()
+ public XmlEvent expectBlock()
throws FOPException, UnexpectedStartElementException
{
return expectStartElement
- (FObjectSets.blockEntity, XMLEvent.DISCARD_W_SPACE);
+ (FObjectSets.blockEntity, XmlEvent.DISCARD_W_SPACE);
}
/**
* <b>6.2 Formatting Object Content</b>, excluding out-of-line flow
* objects which may not occur as descendents of out-of-line formatting
* objects. White space is discarded.
- * @return the <tt>XMLEvent found. If any other events are encountered
+ * @return the <tt>XmlEvent found. If any other events are encountered
* return <tt>null</tt>.
*/
- public XMLEvent expectOutOfLineBlock()
+ public XmlEvent expectOutOfLineBlock()
throws FOPException, UnexpectedStartElementException
{
return expectStartElement
- (FObjectSets.outOfLineBlockSet, XMLEvent.DISCARD_W_SPACE);
+ (FObjectSets.outOfLineBlockSet, XmlEvent.DISCARD_W_SPACE);
}
/**
* objects which may occur except as descendents of out-of-line
* formatting objects. White space is retained, and
* will appear as #PCDATA, i.e, as an instance of FoCharacters.
- * @return the <tt>XMLEvent found. If any other events are encountered
+ * @return the <tt>XmlEvent found. If any other events are encountered
* return <tt>null</tt>.
*/
- public XMLEvent expectPcdataOrInline()
+ public XmlEvent expectPcdataOrInline()
throws FOPException, UnexpectedStartElementException
{
- XMLEvent ev = expectStartElement
- (FObjectSets.normalPcdataInlineSet, XMLEvent.RETAIN_W_SPACE);
+ XmlEvent ev = expectStartElement
+ (FObjectSets.normalPcdataInlineSet, XmlEvent.RETAIN_W_SPACE);
if (ev == null)
ev = expectCharacters();
return ev;
* objects which may not occur as descendents of out-of-line formatting
* objects. White space is retained, and
* will appear as #PCDATA, i.e, as an instance of FoCharacters.
- * @return the <tt>XMLEvent found. If any other events are encountered
+ * @return the <tt>XmlEvent found. If any other events are encountered
* return <tt>null</tt>.
*/
- public XMLEvent expectOutOfLinePcdataOrInline()
+ public XmlEvent expectOutOfLinePcdataOrInline()
throws FOPException, UnexpectedStartElementException
{
- XMLEvent ev = expectStartElement
- (FObjectSets.inlineEntity, XMLEvent.RETAIN_W_SPACE);
+ XmlEvent ev = expectStartElement
+ (FObjectSets.inlineEntity, XmlEvent.RETAIN_W_SPACE);
if (ev == null)
ev = expectCharacters();
return ev;
* objects which may occur except as descendents of out-of-line
* formatting objects. White space is retained, and
* will appear as #PCDATA, i.e, as an instance of FoCharacters.
- * @return the <tt>XMLEvent</tt> found. If any other events are
+ * @return the <tt>XmlEvent</tt> found. If any other events are
* encountered return <tt>null</tt>.
*/
- public XMLEvent expectPcdataOrInlineOrBlock()
+ public XmlEvent expectPcdataOrInlineOrBlock()
throws FOPException, UnexpectedStartElementException
{
- XMLEvent ev = expectStartElement
- (FObjectSets.normalPcdataBlockInlineSet, XMLEvent.RETAIN_W_SPACE);
+ XmlEvent ev = expectStartElement
+ (FObjectSets.normalPcdataBlockInlineSet, XmlEvent.RETAIN_W_SPACE);
if (ev == null)
ev = expectCharacters();
return ev;
* objects which may not occur as descendents of out-of-line formatting
* objects. White space is retained, and
* will appear as #PCDATA, i.e, as an instance of FoCharacters.
- * @return the <tt>XMLEvent</tt> found. If any other events are
+ * @return the <tt>XmlEvent</tt> found. If any other events are
* encountered return <tt>null</tt>.
*/
- public XMLEvent expectOutOfLinePcdataOrInlineOrBlock()
+ public XmlEvent expectOutOfLinePcdataOrInlineOrBlock()
throws FOPException, UnexpectedStartElementException
{
- XMLEvent ev = expectStartElement
+ XmlEvent ev = expectStartElement
(FObjectSets.outOfLinePcdataBlockInlineSet,
- XMLEvent.RETAIN_W_SPACE);
+ XmlEvent.RETAIN_W_SPACE);
if (ev == null)
ev = expectCharacters();
return ev;
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getEndElement() throws FOPException {
- return getSaxEvent(XMLEvent.ENDELEMENT);
+ public XmlEvent getEndElement() throws FOPException {
+ return getSaxEvent(XmlEvent.ENDELEMENT);
}
/**
* @exception NoSuchElementException if ENDELEMENT is not the next
* event detected. The erroneous event is pushed back.
*/
- public XMLEvent expectEndElement(boolean discardWhiteSpace)
+ public XmlEvent expectEndElement(boolean discardWhiteSpace)
throws FOPException
{
- return expectSaxEvent(XMLEvent.ENDELEMENT, discardWhiteSpace);
+ return expectSaxEvent(XmlEvent.ENDELEMENT, discardWhiteSpace);
}
/**
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getEndElement(String qName) throws FOPException
+ public XmlEvent getEndElement(String qName) throws FOPException
{
- return getSaxQNameEvent(XMLEvent.ENDELEMENT, qName);
+ return getSaxQNameEvent(XmlEvent.ENDELEMENT, qName);
}
/**
* @exception NoSuchElementException if end of buffer detected.
*/
/*
- public XMLEvent expectEndElement(String qName, boolean discardWhiteSpace)
+ public XmlEvent expectEndElement(String qName, boolean discardWhiteSpace)
throws FOPException
{
- return expectSaxQNameEvent(XMLEvent.ENDELEMENT, qName, discardWhiteSpace);
+ return expectSaxQNameEvent(XmlEvent.ENDELEMENT, qName, discardWhiteSpace);
}
*/
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getEndElement(int uriIndex, String localName)
+ public XmlEvent getEndElement(int uriIndex, String localName)
throws FOPException
{
- return getSaxUriLocalEvent(XMLEvent.ENDELEMENT, uriIndex, localName);
+ return getSaxUriLocalEvent(XmlEvent.ENDELEMENT, uriIndex, localName);
}
/**
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectEndElement
+ public XmlEvent expectEndElement
(int uriIndex, String localName, boolean discardWhiteSpace)
throws FOPException
{
return expectSaxUriLocalEvent
- (XMLEvent.ENDELEMENT, uriIndex, localName, discardWhiteSpace);
+ (XmlEvent.ENDELEMENT, uriIndex, localName, discardWhiteSpace);
}
/**
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getEndElement(int foType) throws FOPException
+ public XmlEvent getEndElement(int foType) throws FOPException
{
- return getSaxFoEvent(XMLEvent.ENDELEMENT, foType);
+ return getSaxFoEvent(XmlEvent.ENDELEMENT, foType);
}
/**
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectEndElement(int foType, boolean discardWhiteSpace)
+ public XmlEvent expectEndElement(int foType, boolean discardWhiteSpace)
throws FOPException
{
return expectSaxFoEvent
- (XMLEvent.ENDELEMENT, foType, discardWhiteSpace);
+ (XmlEvent.ENDELEMENT, foType, discardWhiteSpace);
}
/**
* Get the next ENDELEMENT event, with the same URI index and local name
- * as the <tt>XMLEvent</tt> argument, from the buffer.
+ * as the <tt>XmlEvent</tt> argument, from the buffer.
* Discard any other events preceding the ENDELEMENT event.
- * @param event an <tt>XMLEvent</tt>. Only the uriIndex and the
- * localName from the event are used. It is intended that the XMLEvent
+ * @param event an <tt>XmlEvent</tt>. Only the uriIndex and the
+ * localName from the event are used. It is intended that the XmlEvent
* returned to the corresponding get/expectStartElement() call be used.
* @return an ENDELEMENT event
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getEndElement(XMLEvent event) throws FOPException
+ public XmlEvent getEndElement(XmlEvent event) throws FOPException
{
int foType;
if ((foType = event.getFoType()) != FObjectNames.NO_FO)
- return getSaxFoEvent(XMLEvent.ENDELEMENT, foType);
+ return getSaxFoEvent(XmlEvent.ENDELEMENT, foType);
return getSaxUriLocalEvent
- (XMLEvent.ENDELEMENT, event.uriIndex, event.localName);
+ (XmlEvent.ENDELEMENT, event.uriIndex, event.localName);
}
/**
* Return the next element if it is an ENDELEMENT with the same
- * URI index and local name as the <tt>XMLEvent argument</tt>. If the
+ * URI index and local name as the <tt>XmlEvent argument</tt>. If the
* next element is not of the required type, push it back onto the buffer.
- * @param event an <tt>XMLEvent</tt>. Only the uriIndex and the
- * localName from the event are used. It is intended that the XMLEvent
+ * @param event an <tt>XmlEvent</tt>. Only the uriIndex and the
+ * localName from the event are used. It is intended that the XmlEvent
* returned to the corresponding get/expectStartElement() call be used.
* @param discardWhiteSpace - if true, discard any <tt>characters</tt>
* events which contain only whitespace.
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectEndElement
- (XMLEvent event, boolean discardWhiteSpace)
+ public XmlEvent expectEndElement
+ (XmlEvent event, boolean discardWhiteSpace)
throws FOPException
{
int foType;
if ((foType = event.getFoType()) != FObjectNames.NO_FO)
return expectSaxFoEvent
- (XMLEvent.ENDELEMENT, foType, discardWhiteSpace);
+ (XmlEvent.ENDELEMENT, foType, discardWhiteSpace);
return expectSaxUriLocalEvent
- (XMLEvent.ENDELEMENT, event.uriIndex, event.localName,
+ (XmlEvent.ENDELEMENT, event.uriIndex, event.localName,
discardWhiteSpace);
}
/**
* Get the next ENDELEMENT event, with the same URI index and local name
- * as the <tt>XMLEvent</tt> argument, from the buffer.
+ * as the <tt>XmlEvent</tt> argument, from the buffer.
* Discard any other events preceding the ENDELEMENT event.
* @param discardEvent the argument event may be discarded.
- * @param event an <tt>XMLEvent</tt>. Only the uriIndex and the
- * localName from the event are used. It is intended that the XMLEvent
+ * @param event an <tt>XmlEvent</tt>. Only the uriIndex and the
+ * localName from the event are used. It is intended that the XmlEvent
* returned to the corresponding get/expectStartElement() call be used.
* @return an ENDELEMENT event
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getEndElement(boolean discardEvent, XMLEvent event)
+ public XmlEvent getEndElement(boolean discardEvent, XmlEvent event)
throws FOPException
{
- XMLEvent ev;
+ XmlEvent ev;
int foType;
if ((foType = event.getFoType()) != FObjectNames.NO_FO)
- ev = getSaxFoEvent(XMLEvent.ENDELEMENT, foType);
+ ev = getSaxFoEvent(XmlEvent.ENDELEMENT, foType);
else
ev = getSaxUriLocalEvent
- (XMLEvent.ENDELEMENT, event.uriIndex, event.localName);
+ (XmlEvent.ENDELEMENT, event.uriIndex, event.localName);
if (discardEvent) {
//System.out.println("discardEvent");
namespaces.surrenderEvent(event);
/**
* Return the next element if it is an ENDELEMENT with the same
- * URI index and local name as the <tt>XMLEvent argument</tt>. If the
+ * URI index and local name as the <tt>XmlEvent argument</tt>. If the
* next element is not of the required type, push it back onto the buffer.
* @param discardEvent the argument event may be discarded.
- * @param event an <tt>XMLEvent</tt>. Only the uriIndex and the
- * localName from the event are used. It is intended that the XMLEvent
+ * @param event an <tt>XmlEvent</tt>. Only the uriIndex and the
+ * localName from the event are used. It is intended that the XmlEvent
* returned to the corresponding get/expectStartElement() call be used.
* @param discardWhiteSpace - if true, discard any <tt>characters</tt>
* events which contain only whitespace.
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectEndElement
- (boolean discardEvent, XMLEvent event, boolean discardWhiteSpace)
+ public XmlEvent expectEndElement
+ (boolean discardEvent, XmlEvent event, boolean discardWhiteSpace)
throws FOPException
{
- XMLEvent ev;
+ XmlEvent ev;
int foType;
if ((foType = event.getFoType()) != FObjectNames.NO_FO)
ev = expectSaxFoEvent
- (XMLEvent.ENDELEMENT, foType, discardWhiteSpace);
+ (XmlEvent.ENDELEMENT, foType, discardWhiteSpace);
else
ev = expectSaxUriLocalEvent
- (XMLEvent.ENDELEMENT, event.uriIndex, event.localName,
+ (XmlEvent.ENDELEMENT, event.uriIndex, event.localName,
discardWhiteSpace);
if (discardEvent)
namespaces.surrenderEvent(event);
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if the event is not found
*/
- public XMLEvent getCharacters() throws FOPException {
- XMLEvent ev = getEvent();
- while (ev != null && ev.type != XMLEvent.CHARACTERS) {
+ public XmlEvent getCharacters() throws FOPException {
+ XmlEvent ev = getEvent();
+ while (ev != null && ev.type != XmlEvent.CHARACTERS) {
namespaces.surrenderEvent(ev);
ev = getEvent();
}
* @exception FOPException if buffer errors or interrupts occur
* @exception NoSuchElementException if end of buffer detected.
*/
- public XMLEvent expectCharacters() throws FOPException {
- XMLEvent ev = getEvent();
- if (ev != null && ev.type == XMLEvent.CHARACTERS) {
+ public XmlEvent expectCharacters() throws FOPException {
+ XmlEvent ev = getEvent();
+ if (ev != null && ev.type == XmlEvent.CHARACTERS) {
return ev;
}
pushBack(ev);
/**
* A class for holding and passing a URI index and local name
- * pair, as used in the <tt>XMLEvent</tt> class.
+ * pair, as used in the <tt>XmlEvent</tt> class.
*/
public class UriLocalName extends Poolable {
protected int uriIndex;
+++ /dev/null
-/*
- * $Id$
- *
- * ============================================================================
- * The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2004 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by the Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- * endorse or promote products derived from this software without prior
- * written permission. For written permission, please contact
- * apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- * "Apache" appear in their name, without prior written permission of the
- * Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- *
- * @author <a href="mailto:pbwest@powerup.com.au">Peter B. West</a>
- * @version $Revision$ $Name$
- */
-package org.apache.fop.xml;
-
-import org.apache.fop.pool.Poolable;
-
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * This is a data class to encapsulate the data of an individual XML
- * parse event. The current version, while defining accessor methods,
- * leaves the component data of the event as protected. The
- * <tt>XMLSerialHandler</tt> methods set the values directly.
- */
-
-public class XMLEvent extends Poolable {
-
- private static final String tag = "$Name$";
- private static final String revision = "$Revision$";
-
- public static final int NOEVENT = 0;
- public static final int STARTDOCUMENT = 1;
- public static final int ENDDOCUMENT = 2;
- public static final int STARTELEMENT = 3;
- public static final int ENDELEMENT = 4;
- public static final int CHARACTERS = 5;
-
- private static final int MIN_XML_EV_TYPE = NOEVENT;
- private static final int MAX_XML_EV_TYPE = CHARACTERS;
-
- public static final boolean DISCARD_W_SPACE = true;
- public static final boolean RETAIN_W_SPACE = false;
-
- public static String eventTypeName(int type) {
- switch (type) {
- case NOEVENT:
- return "NOEVENT";
- case STARTDOCUMENT:
- return "STARTDOCUMENT";
- case ENDDOCUMENT:
- return "ENDDOCUMENT";
- case STARTELEMENT:
- return "STARTELEMENT";
- case ENDELEMENT:
- return "ENDELEMENT";
- case CHARACTERS:
- return "CHARACTERS";
- default:
- return "Unknown type " + type;
- }
- }
-
- // These are made protected specifically so the the values of individual
- // XMLEvent instances can be changed directly, on the assumption that
- // the basic XML events are unlikely to change.
- protected int type = NOEVENT;
- protected String chars;
- protected int uriIndex = Namespaces.DefAttrNSIndex;
- protected String localName;
- protected String qName;
- protected AttributesImpl attributes;
- protected Namespaces namespaces;
-
- /**
- * The one-argument constructor uses the default initialization values:
- * NOEVENT for the event <i>type</i>, the default attribute namespace,
- * and null references for all others except <i>namespaces</i>.
- * @param namespaces the object maintaing the URIs and their indices
- * @param sequence the sequence number of this event within its
- * namespace
- * @param uriIndex the namespace index
- */
- public XMLEvent (Namespaces namespaces, int sequence, int uriIndex ) {
- super(sequence);
- this.namespaces = namespaces;
- this.uriIndex = uriIndex;
- }
-
- /**
- * The fully defined constructor takes values for each of the data
- * elements.
- * @param namespaces the object maintaining the namespaces and their
- * indices
- * @param sequence the next sequence number for this namespace
- * @param type the SAX type of the event
- * @param chars is null unless this is a SAX chars event
- * @param uriIndex the index of the event URI in <b>namespaces</b>
- * @param localName the name associated with the <b>uriIndex</b>
- * @param attributes the AttributesImpl containing the element
- * attributes, if any
- */
- public XMLEvent(Namespaces namespaces, int sequence,
- int type, String chars, int uriIndex,
- String localName, String qName,
- AttributesImpl attributes)
- {
- super(sequence);
- this.namespaces = namespaces;
- this.type = type;
- this.chars = chars;
- this.uriIndex = uriIndex;
- this.localName = localName;
- this.qName = qName;
- this.attributes = attributes;
- }
-
- /**
- * The cloning constructor takes a reference to an existing
- * <tt>XMLEvent</tt> object. Only the <code>id</code> field is not
- * cloned, but set from the <code>sequence</code> parameter.
- * @param ev the event to clone
- * @param sequence the sequence number of the clone
- */
- public XMLEvent(XMLEvent ev, int sequence) {
- super(sequence);
- namespaces = ev.namespaces;
- type = ev.type;
- chars = ev.chars;
- uriIndex = ev.uriIndex;
- localName = ev.localName;
- qName = ev.qName;
- attributes = ev.attributes;
- }
-
-
- /**
- * @param type the SAX type of this event
- * @param chars in this event, if any
- * @param namespaces the object maintaing URIs and their indices
- */
- public XMLEvent(Namespaces namespaces, int sequence,
- int uriIndex, int type, String chars) {
- super(sequence);
- this.namespaces = namespaces;
- this.type = type;
- this.chars = chars;
- // N.B. CHARACTERS events have no namespace - they should always
- // belong to the DefAttrNSpace
- this.uriIndex = uriIndex;
- }
-
- /**
- * Clear the fields of this event. Provided for pool operations.
- * Neither the <i>namespaces</i> nor the <i>id</i> field is cleared.
- * @return the cleared event.
- */
- public Poolable clear() {
- type = NOEVENT;
- chars = null;
- uriIndex = 0;
- localName = null;
- qName = null;
- attributes = null;
- return this;
- }
-
- /**
- * Copy the fields of the argument event to this event.
- * Provided for pool operations.
- * Neither the <i>namespaces</i> nor the <i>id</i> field is copied.
- * @param ev the event to copy.
- * @return this (copied) event.
- */
- public XMLEvent copyEvent(XMLEvent ev) {
- type = ev.type;
- chars = ev.chars;
- uriIndex = ev.uriIndex;
- localName = ev.localName;
- qName = ev.qName;
- attributes = ev.attributes;
- return this;
- }
-
- /**
- * Get the SAX type of this event
- * @return the type
- */
- public int getType() { return type; }
-
- /**
- * Set the SAX event type for this event
- * @param type to which to set this event
- */
- public void setType(int type) {
- if (type < MIN_XML_EV_TYPE || type > MAX_XML_EV_TYPE) {
- throw new IllegalArgumentException(
- "XML event type out of range.");
- }
- this.type = type;
- }
-
- /**
- * Get the chars value of this event
- * @return the chars in this event
- */
- public String getChars() { return chars; }
-
- /**
- * Set the chars field of this event
- * @param chars to set
- */
- public void setChars(String chars) {
- this.chars = chars;
- }
-
- /**
- * Set the chars field for this event. A new string is created from
- * the array passed.
- * @param ch array from which to set chars field
- * @param start index in the <tt>ch</tt> array
- * @param length number of characters to set
- */
- public void setChars(char[] ch, int start, int length) {
- chars = new String(ch, start, length);
- }
-
- /**
- * Get the URI of this event
- * @return the URI
- */
- public String getUri() { return namespaces.getIndexURI(uriIndex); }
-
- /**
- * Get the URI index of this event
- * @return the index of the event URI from <tt>namespaces</tt>
- */
- public int getUriIndex() { return uriIndex; }
-
- /**
- * Set the URI index of this event
- * @param uriIndex of the event URI
- */
- public void setUriIndex(int uriIndex) {
- this.uriIndex = uriIndex;
- }
-
- /**
- * Get the local name of this event.
- * @return the local name.
- */
- public String getLocalName() { return localName; }
-
- /**
- * Set the local name of this event.
- * @param localName - the local name.
- */
- public void setLocalName(String localName) {
- this.localName = localName;
- }
-
- /**
- * Get the qualified name of this event.
- * @return the qualified name.
- */
- public String getQName() { return qName; }
-
- /**
- * Get the prefix of the qualified name of this evetn.
- * @return - the prefix.
- */
- public String getQNamePrefix() {
- int i;
- if ((i = qName.indexOf(':')) == -1) {
- return "";
- } else {
- return qName.substring(0, i);
- }
- }
-
- /**
- * Set the qualified name of this event.
- * @param qName - the qualified name.
- */
- public void setQName(String qName) {
- this.qName = qName;
- }
-
- /**
- * Get the <tt>AttributesImpl</tt> object associated with this event.
- * @return the <tt>AttributesImpl</tt> object.
- */
- public AttributesImpl getAttributes() { return attributes; }
-
- /**
- * Set the <tt>AttributesImpl</tt> object associated with this event.
- * @param attributes the attributes
- */
- public void setAttributes(AttributesImpl attributes) {
- this.attributes = attributes;
- }
-
- /**
- * Set the <tt>Namespaces</tt> object associated with this event.
- * @param namespaces the Namespaces
- */
- public void setNamespaces(Namespaces namespaces) {
- this.namespaces = namespaces;
- }
-
- /**
- * Get the <tt>Namespaces</tt> object associated with this event.
- * @return the <tt>Namespaces</tt> object.
- */
- public Namespaces getNamespaces() { return namespaces; }
-
- /**
- * Illegal operation in superclass
- * @return the foType. Never returns from superclass.
- */
- public int getFoType() {
- throw new UnsupportedOperationException
- ("getFoType not supported in XMLEvent");
- }
-
- /**
- * Illegal operation in superclass
- * @param type the FoType
- */
- public void setFoType(int type) {
- throw new UnsupportedOperationException
- ("setFoType not supported in XMLEvent");
- }
-
- /**
- * Illegal operation in superclass
- * @return the foxType. Never returns from superclass.
- */
- public int getFoxType() {
- throw new UnsupportedOperationException
- ("getFoxType not supported in XMLEvent");
- }
-
- /**
- * Illegal operation in superclass
- * @param type the FoxType
- */
- public void setFoxType(int type) {
- throw new UnsupportedOperationException
- ("setFoxType not supported in XMLEvent");
- }
-
- /**
- * Illegal operation in superclass
- * @return the svgType. Never returns from superclass.
- */
- public int getSvgType() {
- throw new UnsupportedOperationException
- ("getSvgType not supported in XMLEvent");
- }
-
- /**
- * Illegal operation in superclass
- * @param type the svgType
- */
- public void setSvgType(int type) {
- throw new UnsupportedOperationException
- ("setSvgType not supported in XMLEvent");
- }
-
- public String toString() {
- String tstr;
- tstr = eventTypeName(type);
- tstr = tstr + "\nSeq " + id;
- tstr = tstr + "\nNamespaces " + namespaces.hashCode();
- tstr = tstr + "\nURI "
- + uriIndex + " " + namespaces.getIndexURI(uriIndex);
- tstr = tstr + "\n" + "Local Name " + localName;
- tstr = tstr + "\n" + "QName " + qName;
- tstr = tstr + "\n" + "Chars <<<" + chars + ">>>";
- if (attributes == null) {
- tstr = tstr + "\n" + "Attributes null";
- } else {
- int len = attributes.getLength();
- tstr = tstr + "\n" + "No. of attributes " + len;
- for (int i = 0; i < len; i++) {
- tstr = tstr + "\n" + " URI: " + attributes.getURI(i);
- tstr = tstr + "\n" + " QName: " + attributes.getQName(i);
- tstr = tstr + "\n" + " LocalName: "
- + attributes.getLocalName(i);
- tstr = tstr + "\n" + " type: " + attributes.getType(i);
- tstr = tstr + "\n" + " value: " + attributes.getValue(i);
- }
- }
- return tstr;
- }
-
-}
--- /dev/null
+/*
+ * $Id$
+ *
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2004 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ * include the following acknowledgment: "This product includes software
+ * developed by the Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself, if
+ * and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ * endorse or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ * "Apache" appear in their name, without prior written permission of the
+ * Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ *
+ * @author <a href="mailto:pbwest@powerup.com.au">Peter B. West</a>
+ * @version $Revision$ $Name$
+ */
+package org.apache.fop.xml;
+
+import org.apache.fop.pool.Poolable;
+
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ * This is a data class to encapsulate the data of an individual XML
+ * parse event. The current version, while defining accessor methods,
+ * leaves the component data of the event as protected. The
+ * <tt>XMLSerialHandler</tt> methods set the values directly.
+ */
+
+public class XmlEvent extends Poolable {
+
+ private static final String tag = "$Name$";
+ private static final String revision = "$Revision$";
+
+ public static final int NOEVENT = 0;
+ public static final int STARTDOCUMENT = 1;
+ public static final int ENDDOCUMENT = 2;
+ public static final int STARTELEMENT = 3;
+ public static final int ENDELEMENT = 4;
+ public static final int CHARACTERS = 5;
+
+ private static final int MIN_XML_EV_TYPE = NOEVENT;
+ private static final int MAX_XML_EV_TYPE = CHARACTERS;
+
+ public static final boolean DISCARD_W_SPACE = true;
+ public static final boolean RETAIN_W_SPACE = false;
+
+ public static String eventTypeName(int type) {
+ switch (type) {
+ case NOEVENT:
+ return "NOEVENT";
+ case STARTDOCUMENT:
+ return "STARTDOCUMENT";
+ case ENDDOCUMENT:
+ return "ENDDOCUMENT";
+ case STARTELEMENT:
+ return "STARTELEMENT";
+ case ENDELEMENT:
+ return "ENDELEMENT";
+ case CHARACTERS:
+ return "CHARACTERS";
+ default:
+ return "Unknown type " + type;
+ }
+ }
+
+ // These are made protected specifically so the the values of individual
+ // XmlEvent instances can be changed directly, on the assumption that
+ // the basic XML events are unlikely to change.
+ protected int type = NOEVENT;
+ protected String chars;
+ protected int uriIndex = Namespaces.DefAttrNSIndex;
+ protected String localName;
+ protected String qName;
+ protected AttributesImpl attributes;
+ protected Namespaces namespaces;
+
+ /**
+ * The one-argument constructor uses the default initialization values:
+ * NOEVENT for the event <i>type</i>, the default attribute namespace,
+ * and null references for all others except <i>namespaces</i>.
+ * @param namespaces the object maintaing the URIs and their indices
+ * @param sequence the sequence number of this event within its
+ * namespace
+ * @param uriIndex the namespace index
+ */
+ public XmlEvent (Namespaces namespaces, int sequence, int uriIndex ) {
+ super(sequence);
+ this.namespaces = namespaces;
+ this.uriIndex = uriIndex;
+ }
+
+ /**
+ * The fully defined constructor takes values for each of the data
+ * elements.
+ * @param namespaces the object maintaining the namespaces and their
+ * indices
+ * @param sequence the next sequence number for this namespace
+ * @param type the SAX type of the event
+ * @param chars is null unless this is a SAX chars event
+ * @param uriIndex the index of the event URI in <b>namespaces</b>
+ * @param localName the name associated with the <b>uriIndex</b>
+ * @param attributes the AttributesImpl containing the element
+ * attributes, if any
+ */
+ public XmlEvent(Namespaces namespaces, int sequence,
+ int type, String chars, int uriIndex,
+ String localName, String qName,
+ AttributesImpl attributes)
+ {
+ super(sequence);
+ this.namespaces = namespaces;
+ this.type = type;
+ this.chars = chars;
+ this.uriIndex = uriIndex;
+ this.localName = localName;
+ this.qName = qName;
+ this.attributes = attributes;
+ }
+
+ /**
+ * The cloning constructor takes a reference to an existing
+ * <tt>XmlEvent</tt> object. Only the <code>id</code> field is not
+ * cloned, but set from the <code>sequence</code> parameter.
+ * @param ev the event to clone
+ * @param sequence the sequence number of the clone
+ */
+ public XmlEvent(XmlEvent ev, int sequence) {
+ super(sequence);
+ namespaces = ev.namespaces;
+ type = ev.type;
+ chars = ev.chars;
+ uriIndex = ev.uriIndex;
+ localName = ev.localName;
+ qName = ev.qName;
+ attributes = ev.attributes;
+ }
+
+
+ /**
+ * @param type the SAX type of this event
+ * @param chars in this event, if any
+ * @param namespaces the object maintaing URIs and their indices
+ */
+ public XmlEvent(Namespaces namespaces, int sequence,
+ int uriIndex, int type, String chars) {
+ super(sequence);
+ this.namespaces = namespaces;
+ this.type = type;
+ this.chars = chars;
+ // N.B. CHARACTERS events have no namespace - they should always
+ // belong to the DefAttrNSpace
+ this.uriIndex = uriIndex;
+ }
+
+ /**
+ * Clear the fields of this event. Provided for pool operations.
+ * Neither the <i>namespaces</i> nor the <i>id</i> field is cleared.
+ * @return the cleared event.
+ */
+ public Poolable clear() {
+ type = NOEVENT;
+ chars = null;
+ uriIndex = 0;
+ localName = null;
+ qName = null;
+ attributes = null;
+ return this;
+ }
+
+ /**
+ * Copy the fields of the argument event to this event.
+ * Provided for pool operations.
+ * Neither the <i>namespaces</i> nor the <i>id</i> field is copied.
+ * @param ev the event to copy.
+ * @return this (copied) event.
+ */
+ public XmlEvent copyEvent(XmlEvent ev) {
+ type = ev.type;
+ chars = ev.chars;
+ uriIndex = ev.uriIndex;
+ localName = ev.localName;
+ qName = ev.qName;
+ attributes = ev.attributes;
+ return this;
+ }
+
+ /**
+ * Get the SAX type of this event
+ * @return the type
+ */
+ public int getType() { return type; }
+
+ /**
+ * Set the SAX event type for this event
+ * @param type to which to set this event
+ */
+ public void setType(int type) {
+ if (type < MIN_XML_EV_TYPE || type > MAX_XML_EV_TYPE) {
+ throw new IllegalArgumentException(
+ "XML event type out of range.");
+ }
+ this.type = type;
+ }
+
+ /**
+ * Get the chars value of this event
+ * @return the chars in this event
+ */
+ public String getChars() { return chars; }
+
+ /**
+ * Set the chars field of this event
+ * @param chars to set
+ */
+ public void setChars(String chars) {
+ this.chars = chars;
+ }
+
+ /**
+ * Set the chars field for this event. A new string is created from
+ * the array passed.
+ * @param ch array from which to set chars field
+ * @param start index in the <tt>ch</tt> array
+ * @param length number of characters to set
+ */
+ public void setChars(char[] ch, int start, int length) {
+ chars = new String(ch, start, length);
+ }
+
+ /**
+ * Get the URI of this event
+ * @return the URI
+ */
+ public String getUri() { return namespaces.getIndexURI(uriIndex); }
+
+ /**
+ * Get the URI index of this event
+ * @return the index of the event URI from <tt>namespaces</tt>
+ */
+ public int getUriIndex() { return uriIndex; }
+
+ /**
+ * Set the URI index of this event
+ * @param uriIndex of the event URI
+ */
+ public void setUriIndex(int uriIndex) {
+ this.uriIndex = uriIndex;
+ }
+
+ /**
+ * Get the local name of this event.
+ * @return the local name.
+ */
+ public String getLocalName() { return localName; }
+
+ /**
+ * Set the local name of this event.
+ * @param localName - the local name.
+ */
+ public void setLocalName(String localName) {
+ this.localName = localName;
+ }
+
+ /**
+ * Get the qualified name of this event.
+ * @return the qualified name.
+ */
+ public String getQName() { return qName; }
+
+ /**
+ * Get the prefix of the qualified name of this evetn.
+ * @return - the prefix.
+ */
+ public String getQNamePrefix() {
+ int i;
+ if ((i = qName.indexOf(':')) == -1) {
+ return "";
+ } else {
+ return qName.substring(0, i);
+ }
+ }
+
+ /**
+ * Set the qualified name of this event.
+ * @param qName - the qualified name.
+ */
+ public void setQName(String qName) {
+ this.qName = qName;
+ }
+
+ /**
+ * Get the <tt>AttributesImpl</tt> object associated with this event.
+ * @return the <tt>AttributesImpl</tt> object.
+ */
+ public AttributesImpl getAttributes() { return attributes; }
+
+ /**
+ * Set the <tt>AttributesImpl</tt> object associated with this event.
+ * @param attributes the attributes
+ */
+ public void setAttributes(AttributesImpl attributes) {
+ this.attributes = attributes;
+ }
+
+ /**
+ * Set the <tt>Namespaces</tt> object associated with this event.
+ * @param namespaces the Namespaces
+ */
+ public void setNamespaces(Namespaces namespaces) {
+ this.namespaces = namespaces;
+ }
+
+ /**
+ * Get the <tt>Namespaces</tt> object associated with this event.
+ * @return the <tt>Namespaces</tt> object.
+ */
+ public Namespaces getNamespaces() { return namespaces; }
+
+ /**
+ * Illegal operation in superclass
+ * @return the foType. Never returns from superclass.
+ */
+ public int getFoType() {
+ throw new UnsupportedOperationException
+ ("getFoType not supported in XmlEvent");
+ }
+
+ /**
+ * Illegal operation in superclass
+ * @param type the FoType
+ */
+ public void setFoType(int type) {
+ throw new UnsupportedOperationException
+ ("setFoType not supported in XmlEvent");
+ }
+
+ /**
+ * Illegal operation in superclass
+ * @return the foxType. Never returns from superclass.
+ */
+ public int getFoxType() {
+ throw new UnsupportedOperationException
+ ("getFoxType not supported in XmlEvent");
+ }
+
+ /**
+ * Illegal operation in superclass
+ * @param type the FoxType
+ */
+ public void setFoxType(int type) {
+ throw new UnsupportedOperationException
+ ("setFoxType not supported in XmlEvent");
+ }
+
+ /**
+ * Illegal operation in superclass
+ * @return the svgType. Never returns from superclass.
+ */
+ public int getSvgType() {
+ throw new UnsupportedOperationException
+ ("getSvgType not supported in XmlEvent");
+ }
+
+ /**
+ * Illegal operation in superclass
+ * @param type the svgType
+ */
+ public void setSvgType(int type) {
+ throw new UnsupportedOperationException
+ ("setSvgType not supported in XmlEvent");
+ }
+
+ public String toString() {
+ String tstr;
+ tstr = eventTypeName(type);
+ tstr = tstr + "\nSeq " + id;
+ tstr = tstr + "\nNamespaces " + namespaces.hashCode();
+ tstr = tstr + "\nURI "
+ + uriIndex + " " + namespaces.getIndexURI(uriIndex);
+ tstr = tstr + "\n" + "Local Name " + localName;
+ tstr = tstr + "\n" + "QName " + qName;
+ tstr = tstr + "\n" + "Chars <<<" + chars + ">>>";
+ if (attributes == null) {
+ tstr = tstr + "\n" + "Attributes null";
+ } else {
+ int len = attributes.getLength();
+ tstr = tstr + "\n" + "No. of attributes " + len;
+ for (int i = 0; i < len; i++) {
+ tstr = tstr + "\n" + " URI: " + attributes.getURI(i);
+ tstr = tstr + "\n" + " QName: " + attributes.getQName(i);
+ tstr = tstr + "\n" + " LocalName: "
+ + attributes.getLocalName(i);
+ tstr = tstr + "\n" + " type: " + attributes.getType(i);
+ tstr = tstr + "\n" + " value: " + attributes.getValue(i);
+ }
+ }
+ return tstr;
+ }
+
+}