org.jostraca
Class BasicTemplateParser

java.lang.Object
  extended byorg.jostraca.BasicTemplateParser
All Implemented Interfaces:
TemplateActionHandler, TemplateParser

public class BasicTemplateParser
extends java.lang.Object
implements TemplateParser, TemplateActionHandler

Basic implementation of TemplateParser.


Field Summary
static java.lang.String CN
           
protected  char iCloseInnerChar
           
protected  char iCloseOuterChar
           
protected  java.lang.String iDefaultSectionName
           
protected  char iOpenInnerChar
           
protected  char iOpenOuterChar
           
 
Constructor Summary
BasicTemplateParser()
          No Args Constructor.
 
Method Summary
 void append(java.lang.String pContent)
          Append content to the default section
 void append(java.lang.String pSectionName, java.lang.String pContent)
          Append content to a given section.
 void appendToSection(java.lang.String pSectionName, java.lang.String pContent)
          Append text to a given section.
 java.lang.String getDefaultSection()
          Transitional method: Section name needed for creating BasicUnits.
 int getLastElementType()
          Get the element type of the last block processed.
 Section getSection(java.lang.String pSectionName)
          Get the named section.
 SectionSet getSectionSet()
          Get SectionSet built from parse.
 void parse()
          Parse text and update SectionSet.
 void setCloseInnerChar(char pCloseInnerChar)
           
 void setCloseOuterChar(char pCloseOuterChar)
           
 void setDefaultSection(java.lang.String pSectionName)
          Set the default section to add content to.
 void setLastElementType(int pLastElementType)
          Set the element type of the last block processed.
 void setOpenInnerChar(char pOpenInnerChar)
           
 void setOpenOuterChar(char pOpenOuterChar)
           
 void setPropertySet(PropertySet pPropertySet)
          Set PropertySet to be used in parse.
 void setSectionSet(SectionSet pSectionSet)
          Set SectionSet to be used in parse.
 void setSourceText(java.lang.String pSourceText)
          Set text to be parsed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CN

public static final java.lang.String CN

iDefaultSectionName

protected java.lang.String iDefaultSectionName

iOpenOuterChar

protected char iOpenOuterChar

iOpenInnerChar

protected char iOpenInnerChar

iCloseInnerChar

protected char iCloseInnerChar

iCloseOuterChar

protected char iCloseOuterChar
Constructor Detail

BasicTemplateParser

public BasicTemplateParser()
No Args Constructor.

Method Detail

setDefaultSection

public void setDefaultSection(java.lang.String pSectionName)
Description copied from interface: TemplateActionHandler
Set the default section to add content to.

Specified by:
setDefaultSection in interface TemplateActionHandler
Parameters:
pSectionName - Name of default section.

getDefaultSection

public java.lang.String getDefaultSection()
Description copied from interface: TemplateActionHandler
Transitional method: Section name needed for creating BasicUnits.

Specified by:
getDefaultSection in interface TemplateActionHandler

getSection

public Section getSection(java.lang.String pSectionName)
Description copied from interface: TemplateActionHandler
Get the named section.

Specified by:
getSection in interface TemplateActionHandler
Parameters:
pSectionName - Name of section.

append

public void append(java.lang.String pSectionName,
                   java.lang.String pContent)
Description copied from interface: TemplateActionHandler
Append content to a given section.

Specified by:
append in interface TemplateActionHandler
Parameters:
pSectionName - Name of section to append content to.
pContent - Content to append to section.

append

public void append(java.lang.String pContent)
Description copied from interface: TemplateActionHandler
Append content to the default section

Specified by:
append in interface TemplateActionHandler
Parameters:
pContent - Content to append to default section.

appendToSection

public void appendToSection(java.lang.String pSectionName,
                            java.lang.String pContent)
Append text to a given section.

Parameters:
pSectionName - Name of section to append text to.
pContent - Text to append to section.

getLastElementType

public int getLastElementType()
Description copied from interface: TemplateActionHandler
Get the element type of the last block processed.

Specified by:
getLastElementType in interface TemplateActionHandler
See Also:
TemplateActionHandler.getLastElementType()

setLastElementType

public void setLastElementType(int pLastElementType)
Description copied from interface: TemplateActionHandler
Set the element type of the last block processed.

Specified by:
setLastElementType in interface TemplateActionHandler
See Also:
TemplateActionHandler.getLastElementType()

setSourceText

public void setSourceText(java.lang.String pSourceText)
                   throws TemplateParserException
Set text to be parsed.

Specified by:
setSourceText in interface TemplateParser
Parameters:
pSourceText - Text to be parsed
Throws:
TemplateParserException - Thrown if pSourceText is null.

setSectionSet

public void setSectionSet(SectionSet pSectionSet)
                   throws TemplateParserException
Set SectionSet to be used in parse.

Specified by:
setSectionSet in interface TemplateParser
Parameters:
pSectionSet - SectionSet used in parse.
Throws:
TemplateParserException - Thrown if pSourceText is null

setPropertySet

public void setPropertySet(PropertySet pPropertySet)
                    throws TemplateParserException
Set PropertySet to be used in parse.

Specified by:
setPropertySet in interface TemplateParser
Parameters:
pPropertySet - PropertySet used in parse.
Throws:
TemplateParserException - Thrown if pSourceText is null

parse

public void parse()
Parse text and update SectionSet. Errors will return via UserErrorStore when implemented :).

Specified by:
parse in interface TemplateParser

getSectionSet

public SectionSet getSectionSet()
Get SectionSet built from parse.

Specified by:
getSectionSet in interface TemplateParser

setOpenOuterChar

public void setOpenOuterChar(char pOpenOuterChar)

setOpenInnerChar

public void setOpenInnerChar(char pOpenInnerChar)

setCloseInnerChar

public void setCloseInnerChar(char pCloseInnerChar)

setCloseOuterChar

public void setCloseOuterChar(char pCloseOuterChar)


Copyright © 2000-2002 Richard Rodger