xbn.template
Class TemplateData

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.template.TemplateData
All Implemented Interfaces:
Cloneable, Named

public class TemplateData
extends XBNObject
implements Named, Cloneable

Holds the data for a single Template. See Template.

Source code:  TemplateData.java.


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
TemplateData(String s_name, AOSLookup aos_lookup, APString aps_surrText, String s_tagStart, String s_tagEnd)
          Create a TemplateData.
TemplateData(String s_name, AOSLookup aos_lookup, APString aps_surrText, String s_tagStart, String s_tagEnd, boolean b_validateParams)
          Create a TemplateData.
 
Method Summary
protected  Object clone()
          Get a full (deep) copy of this TemplateData as an Object.
 AOSLookup getAOSLookup()
          Get the AOSLookup for direct manipulation.
 APString getAPSSurrText()
          Get the array of strings representing the surrounding, static text.
 String getName()
          What is the name of this object?.
 String getTagEnd()
          Get the tag that ends a gap.
 String getTagStart()
          Get the tag that starts a gap.
 TemplateData getTDClone()
          Get a full (deep) copy of this TemplateData.
 
Methods inherited from class xbn.XBNObject
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateData

public TemplateData(String s_name,
                    AOSLookup aos_lookup,
                    APString aps_surrText,
                    String s_tagStart,
                    String s_tagEnd)

Create a TemplateData.

Equal to TemplateData(s_name, aos_lookup, aps_surrText, s_tagStart, s_tagEnd, true)


TemplateData

public TemplateData(String s_name,
                    AOSLookup aos_lookup,
                    APString aps_surrText,
                    String s_tagStart,
                    String s_tagEnd,
                    boolean b_validateParams)

Create a TemplateData.

Parameters:
s_name - The name of this template. See getName.
aos_lookup - The AOSLookup containing metadata about the gaps. May not be null. See getAOSLookup.
aps_surrText - An APString where the string array contains the surrounding text for this template. May not be null. See getAPSSurrText.
s_tagStart - The full text of the start tag for a gap. May not be null, or zero characters in length. See getTagStart
s_tagEnd - The full text of the end tag for a gap. May not be null, or zero characters in length. See getTagEnd.
b_validateParams - Should all parameters be validated? If true, then yes (and crash if any errors found). Otherwise no. Assume all parameters are valid. Be very sure that, if you set this to false, that the parameters are valid. Otherwise, this class (and entire package) will behave unpredictably.
Method Detail

getAOSLookup

public AOSLookup getAOSLookup()

Get the AOSLookup for direct manipulation.

Returns:
aos_lookup Exactly as provided to the constructor.

getAPSSurrText

public APString getAPSSurrText()

Get the array of strings representing the surrounding, static text. Each element of surrounding text goes between each absolute gap.

This object always has exactly one more element than does

aos_lookup.getUSAPAbsolute().getLength()

The first bit of surrounding text is before the first gap. The second between the first and second gaps, ..., the last bit of surrounding text comes after the last gap.

This contains the text of everything except the gap names themselves (and the tag start and end).

Returns:
aps_surrText Exactly as provided to the constructor.

getTagStart

public String getTagStart()

Get the tag that starts a gap. This text is found immediately before the gap name.

For example: In "~G~my_gap_name~EG~", ~G~ is the gap start tag.

Returns:
s_tagStart Exactly as provided to the constructor.

getTagEnd

public String getTagEnd()

Get the tag that ends a gap. This text is found immediately after the gap name.

For example: In "~G~my_gap_name~EG~", ~EG~ is the gap end tag.

Returns:
s_tagEnd Exactly as provided to the constructor.

getName

public String getName()
Description copied from interface: Named

What is the name of this object?. This identifier is used throughout the xbn.named package, particularly in NamedArray.

Specified by:
getName in interface Named
Returns:
s_name Exactly as provided to the constructor.

getTDClone

public TemplateData getTDClone()

Get a full (deep) copy of this TemplateData.

Returns:
(TemplateData)clone()

clone

protected Object clone()
                throws CloneNotSupportedException

Get a full (deep) copy of this TemplateData as an Object.

Overrides:
clone in class Object



Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.

 

http://sourceforge.net/projects/xbnjava

 

SourceForge.net Logo