|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.writersforge.catalan.templates.generic.GenericOp
Base class for all template ops. Provides a simple Datum wrapper, plus the abstract resolve() method which all ops must implement, plus a static factory method, createOp(), to make it easier to build the correct op class from an arbitrary Datum.
| Constructor Summary | |
GenericOp(org.writersforge.bellows.Datum op,
StyleMap styleMap)
Creates a new instance of GenericOp. |
|
GenericOp(org.writersforge.bellows.Datum op,
StyleMap styleMap,
StyleChain chain)
Creates a new instance of GenericOp with an optional StyleChain argument. |
|
| Method Summary | |
static GenericOp |
createOp(org.writersforge.bellows.Datum op,
StyleMap styleMap)
Factory method for creating new ops. |
static GenericOp |
createOp(org.writersforge.bellows.Datum op,
StyleMap styleMap,
StyleChain chain)
Factory method for creating new ops initialized with an optional StyleChain fallback. |
protected StyleChain |
getChain()
Returns the StyleChain for this op. |
org.writersforge.bellows.Datum |
getDatum()
Returns the op itself. |
java.lang.Object |
getDatumProperty(java.lang.String property)
Returns a property value from the encapsulated Datum op. |
protected org.writersforge.bellows.Datum |
getOp()
Returns the encapsulated Datum op. |
java.lang.String |
getOpType()
Returns the element name of this op. |
protected java.lang.String |
getParameter(char param)
Returns the value of a numbered parameter; used for parameterized queries. |
protected StyleMap |
getStyleMap()
Returns the StyleMap for this op. |
abstract java.util.List |
resolve(org.writersforge.bellows.Datum xmlNode)
Runs a Datum XML node through the op and returns a List of LayoutArea objects. |
protected java.lang.String |
resolveParameter(char param,
org.writersforge.bellows.Datum dataRoot)
Attempts to resolve a parameter against a Datum. |
protected java.lang.String |
resolvePath(java.lang.String path,
org.writersforge.bellows.Datum dataRoot)
Attempts to resolve a parameterized query path. |
protected org.writersforge.bellows.Datum[] |
runQuery(java.lang.String query,
org.writersforge.bellows.Datum dataRoot)
Performs a query on the supplied Datum tree, resolving parameterized variables and managing absolute and relative paths. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GenericOp(org.writersforge.bellows.Datum op,
StyleMap styleMap)
op - the XML template op to wrapstyleMap - the StyleMap to lookup named styles in
public GenericOp(org.writersforge.bellows.Datum op,
StyleMap styleMap,
StyleChain chain)
op - the XML template op to wrapstyleMap - the StyleMap to lookup named styles inchain - optional fallback StyleChain| Method Detail |
public abstract java.util.List resolve(org.writersforge.bellows.Datum xmlNode)
xmlNode - the input data node to run through the op
protected org.writersforge.bellows.Datum getOp()
public java.lang.String getOpType()
public java.lang.Object getDatumProperty(java.lang.String property)
property - the property name in the Datum
public org.writersforge.bellows.Datum getDatum()
protected StyleMap getStyleMap()
protected StyleChain getChain()
protected java.lang.String getParameter(char param)
param - the one-character suffix for the parameter attribute
protected java.lang.String resolveParameter(char param,
org.writersforge.bellows.Datum dataRoot)
param - the one-character suffix for the parameter attributedataRoot - the target data for the query
protected java.lang.String resolvePath(java.lang.String path,
org.writersforge.bellows.Datum dataRoot)
path - a parameterized query pathdataRoot - the target data for the query
protected org.writersforge.bellows.Datum[] runQuery(java.lang.String query,
org.writersforge.bellows.Datum dataRoot)
query - a parameterized Bellows query pathdataRoot - the current context for relative searches
resolvePath
public static GenericOp createOp(org.writersforge.bellows.Datum op,
StyleMap styleMap)
op - the Datum object to wrapstyleMap - the style map for creating LayoutArea objects
public static GenericOp createOp(org.writersforge.bellows.Datum op,
StyleMap styleMap,
StyleChain chain)
op - the Datum object to wrapstyleMap - the style map for creating LayoutArea objectschain - optional fallback StyleChain
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||