org.jbpm.pvm.internal.xml
Class Parse

java.lang.Object
  extended by org.jbpm.pvm.internal.xml.ProblemList
      extended by org.jbpm.pvm.internal.xml.Parse
All Implemented Interfaces:
java.io.Serializable, org.xml.sax.ErrorHandler

public class Parse
extends ProblemList
implements org.xml.sax.ErrorHandler

information related to one single parse operation, for instructions see Parser.

Author:
Tom Baeyens
See Also:
Serialized Form

Field Summary
static java.lang.String CONTEXT_KEY_BINDINGS
           
static java.lang.String CONTEXT_KEY_DEPLOYMENT
           
static java.lang.String CONTEXT_KEY_MIGRATIONS
           
static java.lang.String CONTEXT_KEY_PROCESS_LANGUAGE_ID
           
protected  java.util.Map<java.lang.String,java.lang.Object> contextMap
           
protected  java.util.Stack<java.lang.Object> contextStack
           
protected  org.w3c.dom.Document document
           
protected  javax.xml.parsers.DocumentBuilder documentBuilder
           
protected  java.lang.Object documentObject
           
protected  org.xml.sax.InputSource inputSource
           
protected  java.io.InputStream inputStream
           
protected  Parser parser
           
protected  StreamInput streamInput
           
 
Fields inherited from class org.jbpm.pvm.internal.xml.ProblemList
problems
 
Constructor Summary
protected Parse(Parser parser)
           
 
Method Summary
protected  void addXmlValidationProblem(org.xml.sax.SAXParseException e, java.lang.String type)
           
 Parse checkErrors(java.lang.String description)
          throws an exception with appropriate message in case the parse contains errors or fatal errors.
 java.lang.Object contextMapGet(java.lang.String key)
           
 Parse contextMapPut(java.lang.String key, java.lang.Object value)
           
 Parse contextMapRemove(java.lang.String key)
           
<T> T
contextStackFind(java.lang.Class<T> clazz)
          search a contextual object in the stack by type.
 java.lang.Object contextStackPeek()
          look up the top contextual object from the stack.
 java.lang.Object contextStackPop()
          remove a contextual object from the stack.
 Parse contextStackPush(java.lang.Object object)
          push a contextual object on the stack of this parse.
 void error(org.xml.sax.SAXParseException e)
          part of ErrorHandler to capture XML parsing problems.
 Parse execute()
          perform the actual parse operation with the specified input source.
 void fatalError(org.xml.sax.SAXParseException e)
          part of ErrorHandler to capture XML parsing problems.
 org.w3c.dom.Document getDocument()
          the Document Object Model (DOM).
 java.lang.Object getDocumentObject()
          the result of this parse operation.
protected  org.xml.sax.InputSource getInputSource()
           
 Parse propagateContexMap(Parse parse)
           
 Parse setDocument(org.w3c.dom.Document document)
          normally the Document Object Model is created during the parse execution, but providing a document can be convenient when the DOM is already available and only the walking of the DOM needs to be done by the parser.
 Parse setDocumentObject(java.lang.Object object)
          provides the result of this parse operation.
 Parse setFile(java.io.File file)
          specify a file as the source for this parse
 Parse setInputSource(org.xml.sax.InputSource inputSource)
          specify an InputStream as the source for this parse
 Parse setInputStream(java.io.InputStream inputStream)
          specify an input stream as the source for this parse
 Parse setResource(java.lang.String resource)
          specify a resource as the source for this parse
 Parse setStreamSource(StreamInput streamInput)
          specify a StreamInput as the source for this parse
 Parse setString(java.lang.String xmlString)
          specify an XML string as the source for this parse
 Parse setUrl(java.net.URL url)
          specify a URL as the source for this parse
 void warning(org.xml.sax.SAXParseException e)
          part of ErrorHandler to capture XML parsing problems.
 
Methods inherited from class org.jbpm.pvm.internal.xml.ProblemList
addProblem, addProblem, addProblem, addProblem, addProblem, addProblem, addProblems, getJbpmException, getJbpmException, getProblems, hasErrors, hasProblems, setProblems
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTEXT_KEY_DEPLOYMENT

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

CONTEXT_KEY_PROCESS_LANGUAGE_ID

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

CONTEXT_KEY_BINDINGS

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

CONTEXT_KEY_MIGRATIONS

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

parser

protected Parser parser

streamInput

protected StreamInput streamInput

inputStream

protected java.io.InputStream inputStream

inputSource

protected org.xml.sax.InputSource inputSource

documentBuilder

protected javax.xml.parsers.DocumentBuilder documentBuilder

document

protected org.w3c.dom.Document document

contextMap

protected java.util.Map<java.lang.String,java.lang.Object> contextMap

contextStack

protected java.util.Stack<java.lang.Object> contextStack

documentObject

protected java.lang.Object documentObject
Constructor Detail

Parse

protected Parse(Parser parser)
Method Detail

setInputStream

public Parse setInputStream(java.io.InputStream inputStream)
specify an input stream as the source for this parse


setUrl

public Parse setUrl(java.net.URL url)
specify a URL as the source for this parse


setFile

public Parse setFile(java.io.File file)
specify a file as the source for this parse


setResource

public Parse setResource(java.lang.String resource)
specify a resource as the source for this parse


setString

public Parse setString(java.lang.String xmlString)
specify an XML string as the source for this parse


setStreamSource

public Parse setStreamSource(StreamInput streamInput)
specify a StreamInput as the source for this parse


setInputSource

public Parse setInputSource(org.xml.sax.InputSource inputSource)
specify an InputStream as the source for this parse


setDocument

public Parse setDocument(org.w3c.dom.Document document)
normally the Document Object Model is created during the parse execution, but providing a document can be convenient when the DOM is already available and only the walking of the DOM needs to be done by the parser. If the document is provide, building the DOM from a source is skipped.


setDocumentObject

public Parse setDocumentObject(java.lang.Object object)
provides the result of this parse operation.


getInputSource

protected org.xml.sax.InputSource getInputSource()

execute

public Parse execute()
perform the actual parse operation with the specified input source.


error

public void error(org.xml.sax.SAXParseException e)
part of ErrorHandler to capture XML parsing problems.

Specified by:
error in interface org.xml.sax.ErrorHandler

fatalError

public void fatalError(org.xml.sax.SAXParseException e)
part of ErrorHandler to capture XML parsing problems.

Specified by:
fatalError in interface org.xml.sax.ErrorHandler

warning

public void warning(org.xml.sax.SAXParseException e)
part of ErrorHandler to capture XML parsing problems.

Specified by:
warning in interface org.xml.sax.ErrorHandler

addXmlValidationProblem

protected void addXmlValidationProblem(org.xml.sax.SAXParseException e,
                                       java.lang.String type)

checkErrors

public Parse checkErrors(java.lang.String description)
throws an exception with appropriate message in case the parse contains errors or fatal errors. This method also logs the problems with severity 'warning'.


contextMapPut

public Parse contextMapPut(java.lang.String key,
                           java.lang.Object value)

contextMapGet

public java.lang.Object contextMapGet(java.lang.String key)

contextMapRemove

public Parse contextMapRemove(java.lang.String key)

propagateContexMap

public Parse propagateContexMap(Parse parse)

contextStackPush

public Parse contextStackPush(java.lang.Object object)
push a contextual object on the stack of this parse.


contextStackPop

public java.lang.Object contextStackPop()
remove a contextual object from the stack.


contextStackPeek

public java.lang.Object contextStackPeek()
look up the top contextual object from the stack.


contextStackFind

public <T> T contextStackFind(java.lang.Class<T> clazz)
search a contextual object in the stack by type.


getDocumentObject

public java.lang.Object getDocumentObject()
the result of this parse operation.


getDocument

public org.w3c.dom.Document getDocument()
the Document Object Model (DOM).



Copyright © 2010 JBoss Community. All Rights Reserved.