TPTP 4.5.0 Platform Project
Internal API Specification

org.eclipse.tptp.platform.report.drivers.xml.internal
Class DXmlDocumentReader

java.lang.Object
  extended by org.eclipse.tptp.platform.report.extension.internal.DExtensible
      extended by org.eclipse.tptp.platform.report.tools.internal.DParser
          extended by org.eclipse.tptp.platform.report.drivers.xml.internal.DXmlDocumentReader
All Implemented Interfaces:
IDocumentReader, IReader
Direct Known Subclasses:
XMLGraphicReader

Deprecated. As of TPTP 4.5.0, use the TPTP Business Intelligence and Reporting Tools (BIRT) reporting infrastructure (org.eclipse.tptp.platform.report.birt).

public class DXmlDocumentReader
extends DParser
implements IReader, IDocumentReader

DXmlReader is an extensible class that parse an InputStream and a XML stream to build a jscrib IDItem tree and associated registries (colors,fonts and styles).
The following example reads a document from the xml file named 'myfile.rxml'.

    DXmlReader reader = new DXmlReader();
    try{
      IDObject [] docs = reader.read( new FileInputStream("rxml") );
      // returns only the first document. 
      if (docs.lenght>0 && (docs[0] instanceof DDocument)
          return (DDocument)docs[0];
    }
    catch(Exception e)
    {
      // an error occurs during the file parsing. 
      ...     
    }
 
 

See Also:
read(java.io.InputStream), DExtensible, IReader, InputStream

Nested Class Summary
static class DXmlDocumentReader.Arg
          Deprecated. Argument class for doMethod(), and instance of Arg class will be given as the third parameter.
 
Nested classes/interfaces inherited from class org.eclipse.tptp.platform.report.tools.internal.DParser
DParser.ParserException
 
Nested classes/interfaces inherited from class org.eclipse.tptp.platform.report.extension.internal.DExtensible
DExtensible.InvokeMethod
 
Field Summary
 
Fields inherited from class org.eclipse.tptp.platform.report.extension.internal.DExtensible
mapMethod, paramTab
 
Constructor Summary
DXmlDocumentReader(IXmlParser parser)
          Deprecated. Create a DXmlReader, ready to parse input @see read(InputStream)
 
Method Summary
 void clear()
          Deprecated. Clears the previous parsing internal datas
protected  IDItem createFromClass(java.lang.String class_name)
          Deprecated.  
protected  IDItem createIDItemForNode(org.w3c.dom.Node node)
          Deprecated. Create a IDItem instance from given str.
protected  java.lang.Object createObjectForClassName(java.lang.String class_name, org.w3c.dom.Node node)
          Deprecated. Create an object for class name using node data.
static java.lang.String decode(java.lang.String s)
          Deprecated. Replace few xml entity '&xxx;' to their char value in string.
static IDColor DecodeColor(java.lang.String s)
          Deprecated. decode 6 hexa-digit string RRGGBB into a IDColor
 void doChildrenItem(IDItem parent, DExtensible ext, java.lang.Object a_arg)
          Deprecated. invokeDoMethod() for all node contained in arg (@see class Arg), that aren't filtered (@see Arg class again).
 void doMethod(DAlignmentPair align, DExtensible ext, java.lang.Object t_arg)
          Deprecated. configure a String using node text as string
 void doMethod(java.util.Date date, DExtensible ext, java.lang.Object t_arg)
          Deprecated. configure a Data using node text as setTime()
 void doMethod(DAxis ax, DExtensible ext, java.lang.Object the_arg)
          Deprecated. configure a DAxis
 void doMethod(DCategory cat, DExtensible ext, java.lang.Object arg)
          Deprecated. parses common attribute for 'category' node
 void doMethod(DCurve curv, DExtensible ext, java.lang.Object a_arg)
          Deprecated. configure a DCurve and its children
 void doMethod(DGraphic graph, DExtensible ext, java.lang.Object the_arg)
          Deprecated. configure a DGraphic and it children
 void doMethod(DMarkerLine ml, DExtensible ext, java.lang.Object the_arg)
          Deprecated. parses 'markerLine' element
 void doMethod(DMarkerRegion mr, DExtensible ext, java.lang.Object the_arg)
          Deprecated. parses 'markerRegion' element
 void doMethod(DPalettes pal, DExtensible ext, java.lang.Object the_arg)
          Deprecated. parses 'palettes' element
 void doMethod(DPoint pnt, DExtensible ext, java.lang.Object arg)
          Deprecated. configure a DPoint and it children
 void doMethod(IDCoord coord, DExtensible ext, java.lang.Object a_arg)
          Deprecated. configure a DCoord
 void doMethod(IDStringSerializable v, DExtensible ext, java.lang.Object arg)
          Deprecated. doMethod() for a IDStringSerializable instance, call fromString() on this object
 void doMethod(IDXmlSerializable v, DExtensible ext, java.lang.Object arg)
          Deprecated. doMethod() for a IDXmlSerializable instance, call readXml() on this object
 void doMethod(java.lang.String date, DExtensible ext, java.lang.Object t_arg)
          Deprecated. configure a String using node text as string
 DColorRegistry getColorRegistry()
          Deprecated. Returns the colors which has been loaded by the reader.
 IDObject[] getDocuments()
          Deprecated. Get a list of document objects that were read in.
 DFontRegistry getFontRegistry()
          Deprecated. Returns the fonts which has been loaded by the reader.
static java.lang.String getNodeText(org.w3c.dom.Node node)
          Deprecated.  
protected  org.w3c.dom.Node getRequiredAttribut(org.w3c.dom.NamedNodeMap attr, java.lang.String attr_tag, java.lang.String elt_tag)
          Deprecated. Check if attribute attr_tag is defined in attribute map attr.
 DStyleRegistry getStyleRegistry()
          Deprecated. Returns the styles which has been loaded by the reader.
 IDObject[] getStyles()
          Deprecated. Get a list of style objects that were read in.
protected  void parseAxes(DGraphic graph, DExtensible ext, java.lang.Object the_arg)
          Deprecated. parses 'axes' item
protected  void parseCategories(DAxis ax, DExtensible ext, java.lang.Object the_arg)
          Deprecated. parses 'categories' element
protected  void parseChartTitle(DGraphic g, DExtensible ext, java.lang.Object the_arg)
          Deprecated. parses 'chartTitle' element
protected  void parseCurves(DGraphic graph, DExtensible ext, java.lang.Object the_arg)
          Deprecated. parses 'curves' item
protected  void parseLabelFormat(DAxis ax, DExtensible ext, java.lang.Object a_arg)
          Deprecated. parses 'labelFormat' element
protected  void parseLegend(DGraphic g, DExtensible ext, java.lang.Object the_arg)
          Deprecated. parses 'legend' element
protected  void parseMajorUnit(DAxis ax, DExtensible ext, java.lang.Object a_arg)
          Deprecated. parses 'majorUnit' element
protected  void parseMinorUnit(DAxis ax, DExtensible ext, java.lang.Object a_arg)
          Deprecated. parses 'minorUnit' element
protected  void parsePlotArea(DGraphic g, DExtensible ext, java.lang.Object the_arg)
          Deprecated. parses 'plotArea' element
 IDObject[] read(org.w3c.dom.Document in)
          Deprecated. reads a document directly form a DOM
 IDObject[] read(org.xml.sax.InputSource is)
          Deprecated.  
 IDObject[] read(java.io.InputStream in)
          Deprecated. Parse input stream building one or more documents updating colors,fonts and styles registry (@see getStyleRegistry()).
 org.w3c.dom.Document readDOM(org.xml.sax.InputSource is)
          Deprecated. This is a convience method that reads in an input source that contains an xml input and return a DOM model.
 org.w3c.dom.Document readDOM(java.io.InputStream in)
          Deprecated. This is a convience method that reads in an input stream that contains an xml input and return a DOM model.
 void setColorRegistry(DColorRegistry r)
          Deprecated. override current color registry using the new one
 void setFontRegistry(DFontRegistry r)
          Deprecated. override current font registry using the new one
 void setStyleRegistry(DStyleRegistry r)
          Deprecated. override current style registry using the new one
 void updateExtension(IDExtension ext, java.lang.Class for_extension)
          Deprecated. This method is public due to Signal connection, but must not be called directly.
 
Methods inherited from class org.eclipse.tptp.platform.report.tools.internal.DParser
doMethod, doMethod, doMethod, getListLevel, getTitleLevel
 
Methods inherited from class org.eclipse.tptp.platform.report.extension.internal.DExtensible
doMethod, getDoMethod, installDoMethod, installDoMethods, installDoMethods, invokeDoMethod, invokeSuperDoMethod, removeDoMethod, removeDoMethod, removeDoMethods, removeDoMethods, resolveDoMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DXmlDocumentReader

public DXmlDocumentReader(IXmlParser parser)
Deprecated. 
Create a DXmlReader, ready to parse input @see read(InputStream)

Method Detail

getColorRegistry

public DColorRegistry getColorRegistry()
Deprecated. 
Description copied from interface: IReader
Returns the colors which has been loaded by the reader.

Specified by:
getColorRegistry in interface IReader
Returns:
the color registry

getFontRegistry

public DFontRegistry getFontRegistry()
Deprecated. 
Description copied from interface: IReader
Returns the fonts which has been loaded by the reader.

Specified by:
getFontRegistry in interface IReader

getStyleRegistry

public DStyleRegistry getStyleRegistry()
Deprecated. 
Description copied from interface: IReader
Returns the styles which has been loaded by the reader.

Specified by:
getStyleRegistry in interface IReader

setColorRegistry

public void setColorRegistry(DColorRegistry r)
Deprecated. 
override current color registry using the new one

Specified by:
setColorRegistry in interface IReader

setFontRegistry

public void setFontRegistry(DFontRegistry r)
Deprecated. 
override current font registry using the new one

Specified by:
setFontRegistry in interface IReader

setStyleRegistry

public void setStyleRegistry(DStyleRegistry r)
Deprecated. 
override current style registry using the new one

Specified by:
setStyleRegistry in interface IReader

clear

public void clear()
Deprecated. 
Description copied from class: DParser
Clears the previous parsing internal datas

Specified by:
clear in interface IReader
Overrides:
clear in class DParser

read

public IDObject[] read(java.io.InputStream in)
Deprecated. 
Parse input stream building one or more documents updating colors,fonts and styles registry (@see getStyleRegistry()).

Specified by:
read in interface IDocumentReader
Specified by:
read in interface IReader
Parameters:
in - input stream to use for xml input.
Returns:
one or mode DDocument in an array (can be null).
Throws:
various - exception (ie java.lang.IOException), or DXmlError

readDOM

public org.w3c.dom.Document readDOM(java.io.InputStream in)
Deprecated. 
This is a convience method that reads in an input stream that contains an xml input and return a DOM model.

Parameters:
in - input stream to use for xml input.
Returns:
a DOM that represents the xml input.
Throws:
various - exception (ie java.lang.IOException), or DXmlError

readDOM

public org.w3c.dom.Document readDOM(org.xml.sax.InputSource is)
Deprecated. 
This is a convience method that reads in an input source that contains an xml input and return a DOM model.

Parameters:
in - input source to use for xml input.
Returns:
a DOM that represents the xml input.
Throws:
various - exception (ie java.lang.IOException), or DXmlError

read

public IDObject[] read(org.xml.sax.InputSource is)
Deprecated. 

read

public IDObject[] read(org.w3c.dom.Document in)
Deprecated. 
reads a document directly form a DOM

Specified by:
read in interface IDocumentReader

decode

public static java.lang.String decode(java.lang.String s)
Deprecated. 
Replace few xml entity '&xxx;' to their char value in string.

Returns:
modified string, or s directly.

getRequiredAttribut

protected org.w3c.dom.Node getRequiredAttribut(org.w3c.dom.NamedNodeMap attr,
                                               java.lang.String attr_tag,
                                               java.lang.String elt_tag)
Deprecated. 
Check if attribute attr_tag is defined in attribute map attr.

Returns:
attribute found
Throws:
DXmlError - if attribute attr_tag is not found in node map attr.

getNodeText

public static java.lang.String getNodeText(org.w3c.dom.Node node)
Deprecated. 
Returns:
text from node converted from UTF-8 encoding.

createIDItemForNode

protected IDItem createIDItemForNode(org.w3c.dom.Node node)
Deprecated. 
Create a IDItem instance from given str.

Parameters:
str - the node name to use to create IDItem instance.
ext - a DXmlReader.
o_arg - a CreateIDItemArg instance.
Returns:
an IDItem or null if node isn't an iditem element.

createFromClass

protected IDItem createFromClass(java.lang.String class_name)
Deprecated. 

doChildrenItem

public void doChildrenItem(IDItem parent,
                           DExtensible ext,
                           java.lang.Object a_arg)
Deprecated. 
invokeDoMethod() for all node contained in arg (@see class Arg), that aren't filtered (@see Arg class again).

Overrides:
doChildrenItem in class DParser

doMethod

public void doMethod(DGraphic graph,
                     DExtensible ext,
                     java.lang.Object the_arg)
Deprecated. 
configure a DGraphic and it children


parseLegend

protected void parseLegend(DGraphic g,
                           DExtensible ext,
                           java.lang.Object the_arg)
Deprecated. 
parses 'legend' element


doMethod

public void doMethod(DCategory cat,
                     DExtensible ext,
                     java.lang.Object arg)
Deprecated. 
parses common attribute for 'category' node


parseChartTitle

protected void parseChartTitle(DGraphic g,
                               DExtensible ext,
                               java.lang.Object the_arg)
Deprecated. 
parses 'chartTitle' element


parsePlotArea

protected void parsePlotArea(DGraphic g,
                             DExtensible ext,
                             java.lang.Object the_arg)
Deprecated. 
parses 'plotArea' element


parseCurves

protected void parseCurves(DGraphic graph,
                           DExtensible ext,
                           java.lang.Object the_arg)
Deprecated. 
parses 'curves' item


parseAxes

protected void parseAxes(DGraphic graph,
                         DExtensible ext,
                         java.lang.Object the_arg)
Deprecated. 
parses 'axes' item


doMethod

public void doMethod(DPalettes pal,
                     DExtensible ext,
                     java.lang.Object the_arg)
Deprecated. 
parses 'palettes' element


doMethod

public void doMethod(DAxis ax,
                     DExtensible ext,
                     java.lang.Object the_arg)
Deprecated. 
configure a DAxis


doMethod

public void doMethod(DMarkerLine ml,
                     DExtensible ext,
                     java.lang.Object the_arg)
Deprecated. 
parses 'markerLine' element


doMethod

public void doMethod(DMarkerRegion mr,
                     DExtensible ext,
                     java.lang.Object the_arg)
Deprecated. 
parses 'markerRegion' element


parseCategories

protected void parseCategories(DAxis ax,
                               DExtensible ext,
                               java.lang.Object the_arg)
Deprecated. 
parses 'categories' element


parseMajorUnit

protected void parseMajorUnit(DAxis ax,
                              DExtensible ext,
                              java.lang.Object a_arg)
Deprecated. 
parses 'majorUnit' element


parseMinorUnit

protected void parseMinorUnit(DAxis ax,
                              DExtensible ext,
                              java.lang.Object a_arg)
Deprecated. 
parses 'minorUnit' element


parseLabelFormat

protected void parseLabelFormat(DAxis ax,
                                DExtensible ext,
                                java.lang.Object a_arg)
Deprecated. 
parses 'labelFormat' element


doMethod

public void doMethod(DCurve curv,
                     DExtensible ext,
                     java.lang.Object a_arg)
Deprecated. 
configure a DCurve and its children


doMethod

public void doMethod(DPoint pnt,
                     DExtensible ext,
                     java.lang.Object arg)
Deprecated. 
configure a DPoint and it children


doMethod

public void doMethod(IDCoord coord,
                     DExtensible ext,
                     java.lang.Object a_arg)
Deprecated. 
configure a DCoord


doMethod

public void doMethod(java.util.Date date,
                     DExtensible ext,
                     java.lang.Object t_arg)
Deprecated. 
configure a Data using node text as setTime()


doMethod

public void doMethod(java.lang.String date,
                     DExtensible ext,
                     java.lang.Object t_arg)
Deprecated. 
configure a String using node text as string


doMethod

public void doMethod(DAlignmentPair align,
                     DExtensible ext,
                     java.lang.Object t_arg)
Deprecated. 
configure a String using node text as string


createObjectForClassName

protected java.lang.Object createObjectForClassName(java.lang.String class_name,
                                                    org.w3c.dom.Node node)
Deprecated. 
Create an object for class name using node data. This is for simple class like "java.lang.Byte" this object creation is not extensible nor overridable using DExtensible mechanism. IDXmlSerializable class name is also supported, in this case instance if configured using extensible mechanism.

Returns:
class instance, or null if this is a unknown class.

doMethod

public void doMethod(IDXmlSerializable v,
                     DExtensible ext,
                     java.lang.Object arg)
Deprecated. 
doMethod() for a IDXmlSerializable instance, call readXml() on this object


doMethod

public void doMethod(IDStringSerializable v,
                     DExtensible ext,
                     java.lang.Object arg)
Deprecated. 
doMethod() for a IDStringSerializable instance, call fromString() on this object


updateExtension

public void updateExtension(IDExtension ext,
                            java.lang.Class for_extension)
Deprecated. 
This method is public due to Signal connection, but must not be called directly.


DecodeColor

public static IDColor DecodeColor(java.lang.String s)
Deprecated. 
decode 6 hexa-digit string RRGGBB into a IDColor


getDocuments

public IDObject[] getDocuments()
Deprecated. 
Description copied from interface: IDocumentReader
Get a list of document objects that were read in.

Specified by:
getDocuments in interface IDocumentReader
See Also:
org.eclipse.tptp.platform.report.core.IDocumentReader#getDocuments()

getStyles

public IDObject[] getStyles()
Deprecated. 
Description copied from interface: IDocumentReader
Get a list of style objects that were read in.

Specified by:
getStyles in interface IDocumentReader
See Also:
org.eclipse.tptp.platform.report.core.IDocumentReader#getStyles()

TPTP 4.5.0 Platform Project
Internal API Specification