Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jbreport.core
Class Style  view Style download Style.java

java.lang.Object
  extended byjbreport.core.AbstractReportElement
      extended byjbreport.core.ReportCompositeImpl
          extended byjbreport.core.Style
All Implemented Interfaces:
java.lang.Cloneable, jbreport.ReportComposite, jbreport.ReportElement, jbreport.ReportStylesheet, Traversable, XMLAware, XMLParsingElement

public class Style
extends ReportCompositeImpl
implements jbreport.ReportStylesheet, XMLParsingElement

This represents either a style or a set of styles - known as a style-sheet within a repository. It includes special methods for locating inherited data within a stylesheet.

Version:
$Revision: 1.1 $

Field Summary
private  java.lang.String inheritName
          The name of the style that this inherits from, if any
private  java.util.Map namedStyles
          The named styles within a stylesheet
private  java.lang.String objectType
          The name of the object type that this style applies to, if any
private  java.util.Map params
          The parameters known to this style element
 
Fields inherited from class jbreport.core.ReportCompositeImpl
 
Fields inherited from class jbreport.core.AbstractReportElement
attrType, cdata, className, elementType, factory, name, xmlHandler
 
Fields inherited from interface jbreport.ReportElement
DEEP, SHALLOW
 
Constructor Summary
Style()
           
 
Method Summary
 void accept(ReportVisitor visitor, ReportVisitorState state)
          This defines the operation that the Traversable instance must perform at each node in the traversal.
private  void addParameter(java.lang.String type, java.lang.String value)
           
private static Style findInherited(Style style)
           
 java.lang.String getStyleValue(java.lang.String objectType, java.lang.String className, java.lang.String paramType)
          This method is used to lookup style values.
private static java.lang.String search(Style top, java.lang.String paramType)
           
 boolean xmlCanParse()
          Can this element parse xml in this context? This might be false if the class handles more than one type of element in a hierarchy.
 void xmlCData(XMLHandler handler, java.lang.String cdata)
          This is called to return the embedded character data from the xml element
 void xmlEndChild(jbreport.ReportElement elem)
          This method is called for every child element that is defined during xml tree traversal.
 void xmlInitialize(java.lang.String localName, org.xml.sax.Attributes attributes)
          This should initialize the instance with data obtained during the traversal of an xml tree.
 void xmlParse(XMLHandler handler, java.lang.String localName, org.xml.sax.Attributes attributes)
          This is called to parse some sub-element of this particular element.
 
Methods inherited from class jbreport.core.ReportCompositeImpl
addElement, clearElements, copy, getList, loadData, updateData
 
Methods inherited from class jbreport.core.AbstractReportElement
assert, assertNotNull, boundParameters, breakEventNotify, clone, copy, getBoundParamValue, getElement, getFactory, getName, getParent, getRepository, getString, getStylesheet, getType, inOrderIterator, inOrderTraverse, postOrderIterator, postOrderTraverse, preLoadData, preOrderIterator, preOrderTraverse, setParent, setString, xmlEnd
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jbreport.ReportComposite
addElement
 
Methods inherited from interface jbreport.ReportElement
boundParameters, copy, copy, getBoundParamValue, getElement, getFactory, getList, getName, getParent, getRepository, getString, getStylesheet, getType, loadData, setParent, setString, xmlEnd
 

Field Detail

namedStyles

private java.util.Map namedStyles
The named styles within a stylesheet


params

private java.util.Map params
The parameters known to this style element


inheritName

private java.lang.String inheritName
The name of the style that this inherits from, if any


objectType

private java.lang.String objectType
The name of the object type that this style applies to, if any

Constructor Detail

Style

public Style()
Method Detail

getStyleValue

public java.lang.String getStyleValue(java.lang.String objectType,
                                      java.lang.String className,
                                      java.lang.String paramType)
                               throws jbreport.ReportException
Description copied from interface: jbreport.ReportStylesheet
This method is used to lookup style values.

Specified by:
getStyleValue in interface jbreport.ReportStylesheet

accept

public void accept(ReportVisitor visitor,
                   ReportVisitorState state)
            throws jbreport.ReportException
Description copied from interface: Traversable
This defines the operation that the Traversable instance must perform at each node in the traversal. It should be coded such that it calls an appropriate method on the ReportVisitor instance. Should an appropriate method not exist, one should be coded.

The accept method should not recurse into its children, it is the contract of the iterator to perform that function.

eg:- For node type Section the method on this node should be as follows.

   public void accept(ReportVisitor visitor, ReportVisitorState state) 
      throws ReportException {
      visitor.visitSection(this, state);
   }

Specified by:
accept in interface Traversable
Overrides:
accept in class ReportCompositeImpl

xmlInitialize

public void xmlInitialize(java.lang.String localName,
                          org.xml.sax.Attributes attributes)
                   throws jbreport.ReportException
Description copied from interface: jbreport.ReportElement
This should initialize the instance with data obtained during the traversal of an xml tree. The child-parent relationship is catered for with the xmlEndChild() method.

Specified by:
xmlInitialize in interface jbreport.ReportElement
Overrides:
xmlInitialize in class AbstractReportElement

xmlEndChild

public void xmlEndChild(jbreport.ReportElement elem)
                 throws jbreport.ReportException
Description copied from interface: jbreport.ReportElement
This method is called for every child element that is defined during xml tree traversal. In order to preserve the tree, it will only be called at the end of the child definition.

Specified by:
xmlEndChild in interface jbreport.ReportElement
Overrides:
xmlEndChild in class ReportCompositeImpl

xmlCanParse

public boolean xmlCanParse()
Description copied from interface: XMLParsingElement
Can this element parse xml in this context? This might be false if the class handles more than one type of element in a hierarchy.

Specified by:
xmlCanParse in interface XMLParsingElement

xmlParse

public void xmlParse(XMLHandler handler,
                     java.lang.String localName,
                     org.xml.sax.Attributes attributes)
Description copied from interface: XMLParsingElement
This is called to parse some sub-element of this particular element.

Specified by:
xmlParse in interface XMLParsingElement

xmlCData

public void xmlCData(XMLHandler handler,
                     java.lang.String cdata)
Description copied from interface: XMLParsingElement
This is called to return the embedded character data from the xml element

Specified by:
xmlCData in interface XMLParsingElement

addParameter

private void addParameter(java.lang.String type,
                          java.lang.String value)

search

private static java.lang.String search(Style top,
                                       java.lang.String paramType)

findInherited

private static Style findInherited(Style style)