com.pega.pegarules.pub.generator
Interface ICodeBuffer


public interface ICodeBuffer


Field Summary
static java.lang.String VERSION
           
 
Method Summary
 ICodeBuffer decreaseIndent()
          Decreases the indentation level by one.
 ICodeBuffer emit(java.lang.String aContent)
          Adds specified content fragment to primary buffer.
 ICodeBuffer emitAS(java.lang.String aContent)
          Accumulates the specified content which will be added to the primary buffer at the end of sequence of "emitAS*" method calls as the parameter to the "tools.appendString()" method.
 ICodeBuffer emitASconst(java.lang.String aContent)
          Accumulates the specified content which will be added to the primary buffer at the end of sequence of "emitAS*" method calls as the parameter to the "tools.appendString()" method.
 ICodeBuffer emitASraw(java.lang.String aContent)
          Accumulates the specified content which will be added to the primary buffer at the end of sequence of "emitAS*" method calls as the parameter to the "tools.appendString()" method.
 ICodeBuffer emitCSF(java.lang.String aContent)
          Adds specified content fragment to primary buffer after processing it through StringUtils.crossScriptingFilter.
 ICodeBuffer emitCSFln(java.lang.String aContent)
          Adds specified content fragment to primary buffer after processing it through StringUtils.crossScriptingFilter and then appends a newline character.
 ICodeBuffer emitEscaped(java.lang.String aContent)
          Adds specified content fragment to primary buffer after processing it through StringUtils.escapeIntoJavaString.
 ICodeBuffer emitEscapedln(java.lang.String aContent)
          Adds specified content fragment to primary buffer after processing it through StringUtils.escapeIntoJavaString and then appends a newline character.
 ICodeBuffer emitln(java.lang.String aContent)
          Adds specified content fragment to primary buffer followed by a newline character.
 ICodeBuffer increaseIndent()
          Increases the indentation level by one.
 ICodeBuffer setIndentContent(java.lang.String aIndentContent)
          Sets the desired String to use for each indentation level.
 ICodeBuffer setIndentLevel(int aLevel)
          Sets the desired indentation level (e.g.
 

Field Detail

VERSION

static final java.lang.String VERSION
See Also:
Constant Field Values
Method Detail

setIndentLevel

ICodeBuffer setIndentLevel(int aLevel)
Sets the desired indentation level (e.g. number of leading tab characters)

Parameters:
aLevel - desired level; if less than 0, then 0 will be used
Returns:
CodeBuffer instance

setIndentContent

ICodeBuffer setIndentContent(java.lang.String aIndentContent)
Sets the desired String to use for each indentation level. Defaults to "\t". If, for example, you prefer two spaces then use " ".

Parameters:
aIndentContent - content for each indentation level.
Returns:
CodeBuffer instance

increaseIndent

ICodeBuffer increaseIndent()
Increases the indentation level by one.

Returns:
CodeBuffer instance

decreaseIndent

ICodeBuffer decreaseIndent()
Decreases the indentation level by one. If this would reduce the level to less than zero, the 0 will be used.

Returns:
CodeBuffer instance

emit

ICodeBuffer emit(java.lang.String aContent)
Adds specified content fragment to primary buffer. If this content starts on a new line, then the appropriate indentation will be added prior to the content.

Parameters:
aContent - content to be added
Returns:
CodeBuffer instance

emitln

ICodeBuffer emitln(java.lang.String aContent)
Adds specified content fragment to primary buffer followed by a newline character. If this content starts on a new line, then the appropriate indentation will be added prior to the content.

Parameters:
aContent - content to be added
Returns:
CodeBuffer instance

emitEscaped

ICodeBuffer emitEscaped(java.lang.String aContent)
Adds specified content fragment to primary buffer after processing it through StringUtils.escapeIntoJavaString. If this content starts on a new line, then the appropriate indentation will be added prior to the content.

Parameters:
aContent - content to be added
Returns:
CodeBuffer instance

emitEscapedln

ICodeBuffer emitEscapedln(java.lang.String aContent)
Adds specified content fragment to primary buffer after processing it through StringUtils.escapeIntoJavaString and then appends a newline character. If this content starts on a new line, then the appropriate indentation will be added prior to the content.

Parameters:
aDepth - number of additional times the content should be escaped (specify 0 to escape once, the most typical use)
aContent - content to be added
Returns:
CodeBuffer instance

emitCSF

ICodeBuffer emitCSF(java.lang.String aContent)
Adds specified content fragment to primary buffer after processing it through StringUtils.crossScriptingFilter. If this content starts on a new line, then the appropriate indentation will be added prior to the content.

Parameters:
aContent - content to be added
Returns:
CodeBuffer instance

emitCSFln

ICodeBuffer emitCSFln(java.lang.String aContent)
Adds specified content fragment to primary buffer after processing it through StringUtils.crossScriptingFilter and then appends a newline character. If this content starts on a new line, then the appropriate indentation will be added prior to the content.

Parameters:
aContent - content to be added
Returns:
CodeBuffer instance

emitAS

ICodeBuffer emitAS(java.lang.String aContent)
Accumulates the specified content which will be added to the primary buffer at the end of sequence of "emitAS*" method calls as the parameter to the "tools.appendString()" method. If this sequence of content starts on a new line, then the appropriate indentation will be added prior to the content.

The content will be processed through StringUtils.escapeIntoJavaString.

Parameters:
aContent - content to be added
Returns:
CodeBuffer instance

emitASconst

ICodeBuffer emitASconst(java.lang.String aContent)
Accumulates the specified content which will be added to the primary buffer at the end of sequence of "emitAS*" method calls as the parameter to the "tools.appendString()" method. If this sequence of content starts on a new line, then the appropriate indentation will be added prior to the content.

The content will be processed through StringUtils.escapeIntoJavaString and then surrounded by quotation marks so that the content is treated as a constant String. Consecutive calls to "emitASconst" will have their content merged to a single constant String.

Parameters:
aContent - content to be added
Returns:
CodeBuffer instance

emitASraw

ICodeBuffer emitASraw(java.lang.String aContent)
Accumulates the specified content which will be added to the primary buffer at the end of sequence of "emitAS*" method calls as the parameter to the "tools.appendString()" method. If this sequence of content starts on a new line, then the appropriate indentation will be added prior to the content. Unlike the other "emitAS*" methods, the content will NOT be processed through StringUtils.escapeIntoJavaString.

Parameters:
aContent - content to be added
Returns:
CodeBuffer instance


Copyright © 2012 Pegasystems Inc. All Rights Reserved.