org.eclipse.xtend.core.richstring
Class AbstractRichStringPartAcceptor

java.lang.Object
  extended by org.eclipse.xtend.core.richstring.AbstractRichStringPartAcceptor
All Implemented Interfaces:
IRichStringPartAcceptor
Direct Known Subclasses:
AbstractRichStringPartAcceptor.ForLoopOnce

@NonNullByDefault
public abstract class AbstractRichStringPartAcceptor
extends java.lang.Object
implements IRichStringPartAcceptor

No-op implementation of the IRichStringPartAcceptor. Clients should inherit from this class if they do not want to implement all methods. It is mandatory to implement #forLoopHasNext().

Author:
Sebastian Zarnekow - Initial contribution and API

Nested Class Summary
static class AbstractRichStringPartAcceptor.ForLoopOnce
           
 
Constructor Summary
AbstractRichStringPartAcceptor()
           
 
Method Summary
 void acceptElse()
          Announces that an
 void acceptElseIfCondition(XExpression condition)
          Announces that an
 void acceptEndFor(XExpression after, java.lang.CharSequence indentation)
          Announces that an
 void acceptEndIf()
          Announces that an
 void acceptExpression(XExpression expression, java.lang.CharSequence indentation)
          Announces that an
 void acceptForLoop(JvmFormalParameter parameter, XExpression expression)
          Announces that a
 void acceptIfCondition(XExpression condition)
          Announces that an
 void acceptSemanticLineBreak(int charCount, RichStringLiteral origin, boolean controlStructureSeen)
          Indicates a semantic line break in a rich string literal.
 void acceptSemanticText(java.lang.CharSequence text, RichStringLiteral origin)
           
 void acceptTemplateLineBreak(int charCount, RichStringLiteral origin)
          Indicates a template line break in a rich string literal.
 void acceptTemplateText(java.lang.CharSequence text, RichStringLiteral origin)
           
 void announceNextLiteral(RichStringLiteral object)
          Announces that a next literal will be processed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.xtend.core.richstring.IRichStringPartAcceptor
forLoopHasNext
 

Constructor Detail

AbstractRichStringPartAcceptor

public AbstractRichStringPartAcceptor()
Method Detail

acceptSemanticText

public void acceptSemanticText(java.lang.CharSequence text,
                               @Nullable
                               RichStringLiteral origin)
Specified by:
acceptSemanticText in interface IRichStringPartAcceptor
Parameters:
text - the semantic text. May not be null.
origin - the value holder for the full text or null, if unknown.

acceptTemplateText

public void acceptTemplateText(java.lang.CharSequence text,
                               @Nullable
                               RichStringLiteral origin)
Specified by:
acceptTemplateText in interface IRichStringPartAcceptor
Parameters:
text - the template text. May not be null.
origin - the value holder for the full text or null, if unknown.

acceptSemanticLineBreak

public void acceptSemanticLineBreak(int charCount,
                                    RichStringLiteral origin,
                                    boolean controlStructureSeen)
Description copied from interface: IRichStringPartAcceptor
Indicates a semantic line break in a rich string literal.

Specified by:
acceptSemanticLineBreak in interface IRichStringPartAcceptor
Parameters:
charCount - the number of characters in the line break.
origin - the instance holding the complete text value that contains the line break.

acceptTemplateLineBreak

public void acceptTemplateLineBreak(int charCount,
                                    RichStringLiteral origin)
Description copied from interface: IRichStringPartAcceptor
Indicates a template line break in a rich string literal.

Specified by:
acceptTemplateLineBreak in interface IRichStringPartAcceptor
Parameters:
charCount - the number of characters in the line break.
origin - the instance holding the complete text value that contains the line break.

acceptIfCondition

public void acceptIfCondition(XExpression condition)
Description copied from interface: IRichStringPartAcceptor
Announces that an
«IF condition»
has been consumed.

Specified by:
acceptIfCondition in interface IRichStringPartAcceptor
Parameters:
condition - the condition of an RichStringIf.

acceptElseIfCondition

public void acceptElseIfCondition(XExpression condition)
Description copied from interface: IRichStringPartAcceptor
Announces that an
«ELSEIF condition»
has been consumed.

Specified by:
acceptElseIfCondition in interface IRichStringPartAcceptor
Parameters:
condition - the condition of an RichStringElseIf.

acceptElse

public void acceptElse()
Description copied from interface: IRichStringPartAcceptor
Announces that an
«ELSE»
has been consumed.

Specified by:
acceptElse in interface IRichStringPartAcceptor

acceptEndIf

public void acceptEndIf()
Description copied from interface: IRichStringPartAcceptor
Announces that an
«ENDIF»
has been consumed.

Specified by:
acceptEndIf in interface IRichStringPartAcceptor

acceptForLoop

public void acceptForLoop(JvmFormalParameter parameter,
                          XExpression expression)
Description copied from interface: IRichStringPartAcceptor
Announces that a
«FOR parameter: expression»
has been consumed.

Specified by:
acceptForLoop in interface IRichStringPartAcceptor
Parameters:
parameter - the declared parameter in the for-loop.
expression - the expression that produces an Iterable.

acceptEndFor

public void acceptEndFor(@Nullable
                         XExpression after,
                         java.lang.CharSequence indentation)
Description copied from interface: IRichStringPartAcceptor
Announces that an
«ENDFOR»
has been consumed.

Specified by:
acceptEndFor in interface IRichStringPartAcceptor
Parameters:
after - the expression that should be evaluated after the last item of the loop, if any.
indentation - the additional indentation for any line besides the first one.

acceptExpression

public void acceptExpression(XExpression expression,
                             java.lang.CharSequence indentation)
Description copied from interface: IRichStringPartAcceptor
Announces that an
«expression»
has been consumed. If the expression's evaluation result contains more than one line, any line besides the first one may be prefixed with the given indentation.

Specified by:
acceptExpression in interface IRichStringPartAcceptor
Parameters:
expression - the consumed expression. May not be null.
indentation - the additional indentation for any line besides the first one.

announceNextLiteral

public void announceNextLiteral(RichStringLiteral object)
Description copied from interface: IRichStringPartAcceptor
Announces that a next literal will be processed.

Specified by:
announceNextLiteral in interface IRichStringPartAcceptor
Parameters:
object - the literal.