org.xanot
Class Xanot

java.lang.Object
  extended by org.xanot.Xanot

public class Xanot
extends java.lang.Object

This is the class that, in user point of view, will do all the job.

Author:
Ferdinand Neman (newm4n_at_gmail.com)

Constructor Summary
Xanot()
          Creates a new Xanot object.
 
Method Summary
 java.util.Collection<org.xml.sax.SAXParseException> getErrors()
          Get collection of error exceptions
 java.util.Collection<org.xml.sax.SAXParseException> getFatals()
          Get collection of fatal error exceptions.
 java.lang.Class getRoot()
          Get the root class
 java.util.Collection<org.xml.sax.SAXParseException> getWarnings()
          Get collection of warning exceptions
 boolean isStopOnError()
          Check wether xanot will stop parsing xml when encounters an error.
 boolean isStopOnFatal()
          Check wether xanot will stop parsing xml when encounters a fatal error.
 boolean isStopOnWarning()
          Check wether xanot will stop parsing xml when encounters a warning.
 java.lang.Object parse(java.io.File inputFile)
          Start to parse an xml from a source file.
 java.lang.Object parse(java.io.InputStream inputStream)
          The method to call when starting to parse an xml object
 java.lang.Object parse(java.lang.String inputFilePath)
          Start to parse an xml from a source file on a specified file path.
 void setErrors(java.util.Collection<org.xml.sax.SAXParseException> errors)
          Set collection of error exceptions
 void setFatals(java.util.Collection<org.xml.sax.SAXParseException> fatals)
          Set collection of fatal errors exceptions.
 void setRoot(java.lang.Class root)
          Set the root object.
 void setStopOnError(boolean stopOnError)
          Set xanot to stop or continue parasing when encounters an error.
 void setStopOnFatal(boolean stopOnFatal)
          Set xanot to stop or continue parasing when encounters a fatal error.
 void setStopOnWarning(boolean stopOnWarning)
          Set xanot to stop or continue parasing when encounters a warning.
 void setWarnings(java.util.Collection<org.xml.sax.SAXParseException> warnings)
          Set collection of warning exceptions.
 java.lang.String toString()
          Get this class name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Xanot

public Xanot()
      throws XanotException
Creates a new Xanot object.

Throws:
XanotException - DOCUMENT ME!
Method Detail

getRoot

public java.lang.Class getRoot()
Get the root class

Returns:
Returns the root.

setRoot

public void setRoot(java.lang.Class root)
             throws XanotException
Set the root object. This class will be used as the starting point for xanot to generate mapping rule.

Parameters:
root - The root to set.
Throws:
XanotException

toString

public java.lang.String toString()
Get this class name. Equals to Xanot.class.getName()

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

parse

public java.lang.Object parse(java.io.InputStream inputStream)
                       throws javax.xml.parsers.ParserConfigurationException,
                              org.xml.sax.SAXException,
                              java.io.IOException
The method to call when starting to parse an xml object

Parameters:
inputStream - Input stream as source of the xml data.
Returns:
Return the mapped instance of the object
Throws:
org.xml.sax.SAXException - Thrown if there's an error when parsing.
java.io.IOException - Thrown if there's some problem when accesing the stream.
javax.xml.parsers.ParserConfigurationException - Thrown if the sax parser is not properly configured.

parse

public java.lang.Object parse(java.io.File inputFile)
                       throws org.xml.sax.SAXException,
                              java.io.IOException,
                              javax.xml.parsers.ParserConfigurationException
Start to parse an xml from a source file.

Parameters:
inputFile - Input file
Returns:
Mapped instance as the result.
Throws:
org.xml.sax.SAXException - Thrown if there's an error when parsing.
java.io.IOException - Thrown if there's some problem when accessing file.
javax.xml.parsers.ParserConfigurationException - Thrown if the sax parser is not properly configured.

parse

public java.lang.Object parse(java.lang.String inputFilePath)
                       throws org.xml.sax.SAXException,
                              java.io.IOException,
                              javax.xml.parsers.ParserConfigurationException
Start to parse an xml from a source file on a specified file path.

Parameters:
inputFilePath - Path to the xml file
Returns:
Mapped instance as the result
Throws:
org.xml.sax.SAXException - Thrown if there's an error when parsing.
java.io.IOException - Thrown if there's some problem when accessing file.
javax.xml.parsers.ParserConfigurationException - Thrown if the sax parser is not properly configured.

getWarnings

public java.util.Collection<org.xml.sax.SAXParseException> getWarnings()
Get collection of warning exceptions

Returns:
Collection of warning exceptions.

setWarnings

public void setWarnings(java.util.Collection<org.xml.sax.SAXParseException> warnings)
Set collection of warning exceptions.

Parameters:
warnings - Collection of warning exceptions.

getErrors

public java.util.Collection<org.xml.sax.SAXParseException> getErrors()
Get collection of error exceptions

Returns:
Collection of error exceptions.

setErrors

public void setErrors(java.util.Collection<org.xml.sax.SAXParseException> errors)
Set collection of error exceptions

Parameters:
errors - Collection of error exceptions.

getFatals

public java.util.Collection<org.xml.sax.SAXParseException> getFatals()
Get collection of fatal error exceptions.

Returns:
Collection of fatal error exception.

setFatals

public void setFatals(java.util.Collection<org.xml.sax.SAXParseException> fatals)
Set collection of fatal errors exceptions.

Parameters:
fatals - Collection of fatal error exception.

isStopOnWarning

public boolean isStopOnWarning()
Check wether xanot will stop parsing xml when encounters a warning.

Returns:
True if xanot will stop parsing on warning. False if otherwise.

setStopOnWarning

public void setStopOnWarning(boolean stopOnWarning)
Set xanot to stop or continue parasing when encounters a warning.

Parameters:
stopOnWarning - True to stop xanot when encounter a warning. False if otherwise.

isStopOnError

public boolean isStopOnError()
Check wether xanot will stop parsing xml when encounters an error.

Returns:
True if xanot will stop parsing on error. False if otherwise.

setStopOnError

public void setStopOnError(boolean stopOnError)
Set xanot to stop or continue parasing when encounters an error.

Parameters:
stopOnError - True to stop xanot when encounter an error. False if otherwise.

isStopOnFatal

public boolean isStopOnFatal()
Check wether xanot will stop parsing xml when encounters a fatal error.

Returns:
True if xanot will stop parsing on fatal error. False if otherwise.

setStopOnFatal

public void setStopOnFatal(boolean stopOnFatal)
Set xanot to stop or continue parasing when encounters a fatal error.

Parameters:
stopOnFatal - True to stop xanot when encounter a fatal error. False if otherwise.


Copyright 2006 null. All Rights Reserved.