fipaos.parser.xml
Class XMLContentHandler

java.lang.Object
  |
  +--fipaos.parser.xml.XMLContentHandler
All Implemented Interfaces:
org.xml.sax.DocumentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, Parser

Deprecated. Content objects should be avoided - please use XML Databinding instead

public class XMLContentHandler
extends java.lang.Object
implements Parser, org.xml.sax.EntityResolver, org.xml.sax.DTDHandler, org.xml.sax.ErrorHandler, org.xml.sax.DocumentHandler

Converts between XML messages and Content objects.

XML particular Content object implementation details:



See Also:
XMLDataBinding

Field Summary
static java.lang.String XML_ATTR_CLOSE
          Deprecated.  
static java.lang.String XML_ATTR_OPEN
          Deprecated.  
static java.lang.String XML_CDATA_CLOSE
          Deprecated.  
static java.lang.String XML_CDATA_CLOSE_REPLACE
          Deprecated.  
static java.lang.String XML_CDATA_START
          Deprecated.  
static java.lang.String XML_DTD_END
          Deprecated.  
static java.lang.String XML_DTD_MIDDLE
          Deprecated.  
static java.lang.String XML_DTD_START
          Deprecated.  
static java.lang.String XML_HEADER
          Deprecated. The tag found at the start of every XML document
static java.lang.String XML_SPACE
          Deprecated.  
static java.lang.String XML_TAG_CLOSE
          Deprecated.  
static java.lang.String XML_TAG_CLOSE_END
          Deprecated.  
static java.lang.String XML_TAG_OPEN
          Deprecated.  
static java.lang.String XML_TAG_OPEN_END
          Deprecated.  
 
Constructor Summary
XMLContentHandler()
          Deprecated. Default constructor for this Parser.
 
Method Summary
 boolean canParse(java.lang.String content)
          Deprecated. Determines if the Parser implementation can parse the given content
 void characters(char[] ch, int start, int length)
          Deprecated. Receive notification of character data inside an element.
 java.lang.String deparse(Content content)
          Deprecated. This method converts a Content object into a document which is of a format determined by the Parser implementation.
 void endDocument()
          Deprecated. Receive notification of the end of the document.
 void endElement(java.lang.String name)
          Deprecated. Receive notification of the end of an element.
 void error(org.xml.sax.SAXParseException e)
          Deprecated. Receive notification of a recoverable parser error.
 void fatalError(org.xml.sax.SAXParseException e)
          Deprecated. Report a fatal XML parsing error.
static java.lang.String getNormalisedForm(java.lang.String non_normalised)
          Deprecated. If necessary converts the given String into a format suitable for placing within an XML tags (i.e.
 java.lang.String getParserType()
          Deprecated. Returns the type of content language that the Parser implementation handles.
 void ignorableWhitespace(char[] ch, int start, int length)
          Deprecated. Receive notification of ignorable whitespace in element content.
static boolean isXML(java.lang.String content)
          Deprecated. Indicates if the given content is an XML document
static void main(java.lang.String[] args)
          Deprecated.  
 void notationDecl(java.lang.String p1, java.lang.String p2, java.lang.String p3)
          Deprecated. Receive notification of a notation declaration.
 Content parse(java.lang.String content)
          Deprecated. This method converts a content String into a set of Content objects
 void processingInstruction(java.lang.String target, java.lang.String data)
          Deprecated. Receive notification of a processing instruction.
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
          Deprecated. Resolve an external entity.
 void setDocumentLocator(org.xml.sax.Locator locator)
          Deprecated. Receive a Locator object for document events.
 void startDocument()
          Deprecated. Receive notification of the beginning of the document.
 void startElement(java.lang.String name, org.xml.sax.AttributeList attributes)
          Deprecated. Receive notification of the start of an element.
 void unparsedEntityDecl(java.lang.String p1, java.lang.String p2, java.lang.String p3, java.lang.String p4)
          Deprecated. Receive notification of an unparsed entity declaration.
 void warning(org.xml.sax.SAXParseException e)
          Deprecated. Receive notification of a parser warning.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_HEADER

public static final java.lang.String XML_HEADER
Deprecated. 
The tag found at the start of every XML document

XML_TAG_OPEN

public static final java.lang.String XML_TAG_OPEN
Deprecated. 

XML_TAG_OPEN_END

public static final java.lang.String XML_TAG_OPEN_END
Deprecated. 

XML_TAG_CLOSE

public static final java.lang.String XML_TAG_CLOSE
Deprecated. 

XML_TAG_CLOSE_END

public static final java.lang.String XML_TAG_CLOSE_END
Deprecated. 

XML_ATTR_OPEN

public static final java.lang.String XML_ATTR_OPEN
Deprecated. 

XML_ATTR_CLOSE

public static final java.lang.String XML_ATTR_CLOSE
Deprecated. 

XML_CDATA_START

public static final java.lang.String XML_CDATA_START
Deprecated. 

XML_CDATA_CLOSE

public static final java.lang.String XML_CDATA_CLOSE
Deprecated. 

XML_CDATA_CLOSE_REPLACE

public static final java.lang.String XML_CDATA_CLOSE_REPLACE
Deprecated. 

XML_DTD_START

public static final java.lang.String XML_DTD_START
Deprecated. 

XML_DTD_MIDDLE

public static final java.lang.String XML_DTD_MIDDLE
Deprecated. 

XML_DTD_END

public static final java.lang.String XML_DTD_END
Deprecated. 

XML_SPACE

public static final java.lang.String XML_SPACE
Deprecated. 
Constructor Detail

XMLContentHandler

public XMLContentHandler()
Deprecated. 
Default constructor for this Parser. Used buy the ParserFactory
Method Detail

deparse

public java.lang.String deparse(Content content)
Deprecated. 
This method converts a Content object into a document which is of a format determined by the Parser implementation.
Specified by:
deparse in interface Parser
Parameters:
content - The Content object to deparse
Returns:
The Stringified representation of the Content object

parse

public Content parse(java.lang.String content)
Deprecated. 
This method converts a content String into a set of Content objects
Specified by:
parse in interface Parser
Parameters:
content - The String to parse into Content objects
Returns:
A Content object representing the content String given.

canParse

public boolean canParse(java.lang.String content)
Deprecated. 
Determines if the Parser implementation can parse the given content
Specified by:
canParse in interface Parser
Parameters:
content - The content to be tested
Returns:
True if the Parser implementation can parse the given String

getParserType

public java.lang.String getParserType()
Deprecated. 
Returns the type of content language that the Parser implementation handles.
Specified by:
getParserType in interface Parser
Returns:
A String representation of the content format (e.g. RDF, SL)

isXML

public static boolean isXML(java.lang.String content)
Deprecated. 
Indicates if the given content is an XML document
Parameters:
content - The content to check
Returns:
True if the content is XML

getNormalisedForm

public static java.lang.String getNormalisedForm(java.lang.String non_normalised)
Deprecated. 
If necessary converts the given String into a format suitable for placing within an XML tags (i.e. appropriate characters extracted and replaced to ensure unambiguous parsing)
Parameters:
non_normalised - String to be correctly formatted
Returns:
A String representing the same information as the original String, but in an XML-friendly format

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
                                      throws org.xml.sax.SAXException
Deprecated. 
Resolve an external entity.
Specified by:
resolveEntity in interface org.xml.sax.EntityResolver
Parameters:
publicId - The public identifer, or null if none is available.
systemId - The system identifier provided in the XML document.
Returns:
The new input source, or null to require the default behaviour.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
EntityResolver.resolveEntity(java.lang.String, java.lang.String)

unparsedEntityDecl

public void unparsedEntityDecl(java.lang.String p1,
                               java.lang.String p2,
                               java.lang.String p3,
                               java.lang.String p4)
                        throws org.xml.sax.SAXException
Deprecated. 
Receive notification of an unparsed entity declaration.
Specified by:
unparsedEntityDecl in interface org.xml.sax.DTDHandler
Parameters:
name - The entity name.
publicId - The entity public identifier, or null if not available.
systemId - The entity system identifier.
notationName - The name of the associated notation.
See Also:
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

notationDecl

public void notationDecl(java.lang.String p1,
                         java.lang.String p2,
                         java.lang.String p3)
                  throws org.xml.sax.SAXException
Deprecated. 
Receive notification of a notation declaration.
Specified by:
notationDecl in interface org.xml.sax.DTDHandler
Parameters:
name - The notation name.
publicId - The notation public identifier, or null if not available.
systemId - The notation system identifier.
See Also:
DTDHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String)

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Deprecated. 
Receive a Locator object for document events.
Specified by:
setDocumentLocator in interface org.xml.sax.DocumentHandler
Parameters:
locator - A locator for all SAX document events.
See Also:
DocumentHandler.setDocumentLocator(org.xml.sax.Locator), Locator

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Deprecated. 
Receive notification of the beginning of the document.
Specified by:
startDocument in interface org.xml.sax.DocumentHandler
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DocumentHandler.startDocument()

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Deprecated. 
Receive notification of the end of the document.
Specified by:
endDocument in interface org.xml.sax.DocumentHandler
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DocumentHandler.endDocument()

startElement

public void startElement(java.lang.String name,
                         org.xml.sax.AttributeList attributes)
                  throws org.xml.sax.SAXException
Deprecated. 
Receive notification of the start of an element.
Specified by:
startElement in interface org.xml.sax.DocumentHandler
Parameters:
name - The element type name.
attributes - The specified or defaulted attributes.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DocumentHandler.startElement(java.lang.String, org.xml.sax.AttributeList)

endElement

public void endElement(java.lang.String name)
                throws org.xml.sax.SAXException
Deprecated. 
Receive notification of the end of an element.
Specified by:
endElement in interface org.xml.sax.DocumentHandler
Parameters:
name - The element type name.
attributes - The specified or defaulted attributes.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DocumentHandler.endElement(java.lang.String)

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Deprecated. 
Receive notification of character data inside an element.
Specified by:
characters in interface org.xml.sax.DocumentHandler
Parameters:
ch - The characters.
start - The start position in the character array.
length - The number of characters to use from the character array.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DocumentHandler.characters(char[], int, int)

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws org.xml.sax.SAXException
Deprecated. 
Receive notification of ignorable whitespace in element content.
Specified by:
ignorableWhitespace in interface org.xml.sax.DocumentHandler
Parameters:
ch - The whitespace characters.
start - The start position in the character array.
length - The number of characters to use from the character array.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DocumentHandler.ignorableWhitespace(char[], int, int)

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Deprecated. 
Receive notification of a processing instruction.
Specified by:
processingInstruction in interface org.xml.sax.DocumentHandler
Parameters:
target - The processing instruction target.
data - The processing instruction data, or null if none is supplied.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DocumentHandler.processingInstruction(java.lang.String, java.lang.String)

warning

public void warning(org.xml.sax.SAXParseException e)
             throws org.xml.sax.SAXException
Deprecated. 
Receive notification of a parser warning.
Specified by:
warning in interface org.xml.sax.ErrorHandler
Parameters:
e - The warning information encoded as an exception.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
ErrorHandler.warning(org.xml.sax.SAXParseException), SAXParseException

error

public void error(org.xml.sax.SAXParseException e)
           throws org.xml.sax.SAXException
Deprecated. 
Receive notification of a recoverable parser error.
Specified by:
error in interface org.xml.sax.ErrorHandler
Parameters:
e - The warning information encoded as an exception.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
ErrorHandler.warning(org.xml.sax.SAXParseException), SAXParseException

fatalError

public void fatalError(org.xml.sax.SAXParseException e)
                throws org.xml.sax.SAXException
Deprecated. 
Report a fatal XML parsing error.
Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Parameters:
e - The error information encoded as an exception.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
ErrorHandler.fatalError(org.xml.sax.SAXParseException), SAXParseException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Deprecated.