|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.SaxHandlerBase org.xmlBlaster.client.script.XmlScriptInterpreter org.xmlBlaster.util.xbformat.XmlScriptParser
public class XmlScriptParser
XmlScriptParser class for XML formated messages.
This class creates and parses xml script messages which can be used to
transfer over a email or socket connection.
XmlScriptParser instances may be reused, but are NOT reentrant (there are
many 'global' variables)
Please read the requirement specification The
client.script requirement
Field Summary | |
---|---|
static java.lang.String |
XMLSCRIPT_EXTENSION
|
static java.lang.String |
XMLSCRIPT_MIMETYPE
|
static java.lang.String |
XMLSCRIPT_ZLIB_EXTENSION
|
static java.lang.String |
XMLSCRIPT_ZLIB_MIMETYPE
|
Fields inherited from class org.xmlBlaster.client.script.XmlScriptInterpreter |
---|
cdata, CONTENT_TAG, contentData, ECHO_TAG, forceReadable, inhibitContentCDATAWrapping, INPUT_TAG, key, KEY_TAG, messageList, needsRootEndTag, out, qos, QOS_TAG, response, ROOT_TAG, ROOTRESPONSE_TAG, sendSimpleExceptionFormat, simpleExceptionFormatList, updateCounter, WAIT_TAG, waitMutex, waitNumUpdates |
Fields inherited from class org.xmlBlaster.util.SaxHandlerBase |
---|
character, locator, xmlLiteral, xmlSource |
Constructor Summary | |
---|---|
XmlScriptParser()
|
Method Summary | |
---|---|
byte[] |
createRawMsg(MsgInfo msgInfo)
Returns a XML data string. |
boolean |
fireMethod(MethodName methodName,
java.lang.String sessionId,
java.lang.String requestId,
byte type)
Called during XML parsing. |
static java.lang.String |
getEncodingFromProcessingInstruction(java.lang.String pi)
|
java.lang.String |
getExtension(boolean isCompressed)
Get a specific extension for this format. |
java.lang.String |
getMimetype(boolean isCompressed)
Get a specific extension for this format. |
void |
init(Global glob,
I_ProgressListener progressListener,
I_PluginConfig pluginConfig)
Is guaranteed to be called by the MsgInfoParserFactory after construction. |
boolean |
isNullTerminated()
If used by email, the InputStream finishes when the attaachment is read, if used over socket, we need to terminate each script with a null byte |
static void |
main(java.lang.String[] args)
java org.xmlBlaster.util.xbformat.XmlScriptParser |
MsgInfo[] |
parse(java.io.InputStream in)
This parses the raw message from an InputStream (typically from a email or a socket). |
void |
setProperty(java.lang.String key,
java.lang.String value)
Called during XML parsing. |
java.lang.String |
toLiteral(byte[] arr)
Get the raw messages as a string, for tests and for dumping only. |
java.lang.String |
toLiteral(MsgInfo msgInfo)
Get the raw messages as a string, for tests and for dumping only |
Methods inherited from class org.xmlBlaster.client.script.XmlScriptInterpreter |
---|
buildMsgUnit, characters, dumpToFile, endCDATA, endElement, flushResponse, initialize, parse, replaceVariable, serialize, simplifiedErrorCode, startCDATA, startElement, update, wrapForScripting, wrapForScripting, wrapForScripting, writeElementStart |
Methods inherited from class org.xmlBlaster.util.SaxHandlerBase |
---|
comment, endDocument, endDTD, endEntity, endPrefixMapping, error, fatalError, getUseLexicalHandler, ignorableWhitespace, init, init, init, notationDecl, processingInstruction, setDocumentLocator, setUseLexicalHandler, skippedEntity, startDocument, startDTD, startEntity, startPrefixMapping, toString, toXml, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String XMLSCRIPT_EXTENSION
public static final java.lang.String XMLSCRIPT_ZLIB_EXTENSION
public static final java.lang.String XMLSCRIPT_MIMETYPE
public static final java.lang.String XMLSCRIPT_ZLIB_MIMETYPE
Constructor Detail |
---|
public XmlScriptParser()
Method Detail |
---|
public static java.lang.String getEncodingFromProcessingInstruction(java.lang.String pi)
public void init(Global glob, I_ProgressListener progressListener, I_PluginConfig pluginConfig) throws XmlBlasterException
I_MsgInfoParser
init
in interface I_MsgInfoParser
pluginConfig
- Can be null
XmlBlasterException
public java.lang.String getMimetype(boolean isCompressed)
getMimetype
in interface I_MsgInfoParser
public final java.lang.String getExtension(boolean isCompressed)
I_MsgInfoParser
getExtension
in interface I_MsgInfoParser
isCompressed
- true/false
public final MsgInfo[] parse(java.io.InputStream in) throws java.io.IOException, XmlBlasterException
parse
in interface I_MsgInfoParser
in
- The raw, serialized data
java.io.IOException
XmlBlasterException
public void setProperty(java.lang.String key, java.lang.String value) throws XmlBlasterException
setProperty
in class XmlScriptInterpreter
XmlBlasterException
public boolean fireMethod(MethodName methodName, java.lang.String sessionId, java.lang.String requestId, byte type) throws XmlBlasterException
fireMethod
in class XmlScriptInterpreter
type
- 'I'=invoke 'R'=response 'E'=exception
XmlBlasterException
- Will lead to stop parsing furtherpublic final byte[] createRawMsg(MsgInfo msgInfo) throws XmlBlasterException
createRawMsg
in interface I_MsgInfoParser
XmlBlasterException
public final java.lang.String toLiteral(MsgInfo msgInfo) throws XmlBlasterException
toLiteral
in interface I_MsgInfoParser
XmlBlasterException
public final java.lang.String toLiteral(byte[] arr)
I_MsgInfoParser
toLiteral
in interface I_MsgInfoParser
arr
- The raw blob
public static void main(java.lang.String[] args)
public boolean isNullTerminated()
|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |