Business Objects
Quark Platform Documentation
Version 1.7.0_0
Business Objects

org.openquark.cal.compiler
Class CALDocComment.CodeSegment

java.lang.Object
  extended by org.openquark.cal.compiler.CALDocComment.Segment
      extended by org.openquark.cal.compiler.CALDocComment.InlineTagSegment
          extended by org.openquark.cal.compiler.CALDocComment.CodeSegment
Enclosing class:
CALDocComment

public static final class CALDocComment.CodeSegment
extends CALDocComment.InlineTagSegment

Represents a block of source code in a CALDoc comment. In generating formatted output, the whitespace contained within the text is respected.

Author:
Joseph Wong

Method Summary
<T,R> R
accept(CALDocCommentTextBlockVisitor<T,R> visitor, T arg)
          Accepts the visitation of a visitor, which implements the CALDocCommentTextBlockVisitor interface.
 CALDocComment.TextBlock getContent()
           
 void toStringBuilder(StringBuilder result, int indentLevel)
          Fills the given StringBuilder with a string representation of this instance.
 
Methods inherited from class org.openquark.cal.compiler.CALDocComment.Segment
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getContent

public CALDocComment.TextBlock getContent()
Returns:
the text of the block of source code.

accept

public <T,R> R accept(CALDocCommentTextBlockVisitor<T,R> visitor,
                      T arg)
Accepts the visitation of a visitor, which implements the CALDocCommentTextBlockVisitor interface. This abstract method is to be overridden by each concrete subclass so that the correct visit method on the visitor may be called based upon the type of the element being visited.

As the CALDocCommentTextBlockVisitor follows a more general visitor pattern where arguments can be passed into the visit methods and return values obtained from them, this method passes through the argument into the visit method, and returns as its return value the return value of the visit method.

Nonetheless, for a significant portion of the common cases, the state of the visitation can simply be kept as member variables within the visitor itself, thereby eliminating the need to use the argument and return value of the visit methods. In these scenarios, the recommended approach is to use Void as the type argument for both T and R, and pass in null as the argument, and return null as the return value.

Specified by:
accept in class CALDocComment.Segment
Type Parameters:
T - the argument type. If the visitation argument is not used, specify Void.
R - the return type. If the return value is not used, specify Void.
Parameters:
visitor - the visitor.
arg - the argument to be passed to the visitor's visitXXX method.
Returns:
the return value of the visitor's visitXXX method.

toStringBuilder

public void toStringBuilder(StringBuilder result,
                            int indentLevel)
Fills the given StringBuilder with a string representation of this instance.

Specified by:
toStringBuilder in class CALDocComment.Segment
Parameters:
result - the StringBuilder to fill.
indentLevel - the indent level to use in indenting the generated text.

Business Objects
Quark Platform Documentation
Version 1.7.0_0
Business Objects

Copyright © 2007 Business Objects. All rights reserved.