org.eclipse.xtext.xtend2.validation
Class ValidatingRichStringAcceptor

java.lang.Object
  extended by org.eclipse.xtext.xtend2.richstring.AbstractRichStringPartAcceptor
      extended by org.eclipse.xtext.xtend2.richstring.AbstractRichStringPartAcceptor.ForLoopOnce
          extended by org.eclipse.xtext.xtend2.validation.ValidatingRichStringAcceptor
All Implemented Interfaces:
IRichStringIndentationHandler, IRichStringPartAcceptor

public class ValidatingRichStringAcceptor
extends AbstractRichStringPartAcceptor.ForLoopOnce
implements IRichStringIndentationHandler

Author:
Sebastian Zarnekow - Initial contribution and API

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.xtext.xtend2.richstring.AbstractRichStringPartAcceptor
AbstractRichStringPartAcceptor.ForLoopOnce
 
Constructor Summary
ValidatingRichStringAcceptor(ValidationMessageAcceptor acceptor)
           
 
Method Summary
 void accept(IRichStringPartAcceptor acceptor)
          Announce the current indentation to the acceptor.
 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.
 java.lang.CharSequence getTotalIndentation()
          Return the current indentation.
 java.lang.CharSequence getTotalSemanticIndentation()
          Return the current semantic indentation.
 void popIndentation()
          Drop the recently announced indentation and use the previous state.
protected  void pushIndentation(java.lang.CharSequence completeIndentation)
           
 void pushSemanticIndentation(java.lang.CharSequence completeIndentation)
          Announce semantic indentation.
 void pushTemplateIndentation(java.lang.CharSequence completeIndentation)
          Announce template indentation.
protected  void resetCurrentOffset(RichStringLiteral origin)
           
 
Methods inherited from class org.eclipse.xtext.xtend2.richstring.AbstractRichStringPartAcceptor.ForLoopOnce
acceptEndFor, acceptForLoop, forLoopHasNext
 
Methods inherited from class org.eclipse.xtext.xtend2.richstring.AbstractRichStringPartAcceptor
acceptElse, acceptElseIfCondition, acceptEndIf, acceptExpression, acceptIfCondition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatingRichStringAcceptor

public ValidatingRichStringAcceptor(ValidationMessageAcceptor acceptor)
Method Detail

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
Overrides:
announceNextLiteral in class AbstractRichStringPartAcceptor
Parameters:
object - the literal.

acceptSemanticText

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

resetCurrentOffset

protected void resetCurrentOffset(RichStringLiteral origin)

acceptTemplateText

public void acceptTemplateText(java.lang.CharSequence text,
                               RichStringLiteral origin)
Specified by:
acceptTemplateText in interface IRichStringPartAcceptor
Overrides:
acceptTemplateText in class AbstractRichStringPartAcceptor
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
Overrides:
acceptSemanticLineBreak in class AbstractRichStringPartAcceptor
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
Overrides:
acceptTemplateLineBreak in class AbstractRichStringPartAcceptor
Parameters:
charCount - the number of characters in the line break.
origin - the instance holding the complete text value that contains the line break.

pushTemplateIndentation

public void pushTemplateIndentation(java.lang.CharSequence completeIndentation)
Description copied from interface: IRichStringIndentationHandler
Announce template indentation. The passed indentation is expected to contain the complete whitespace prefix of a line. Implementors will extract the new parts from it automatically.

Specified by:
pushTemplateIndentation in interface IRichStringIndentationHandler
Parameters:
completeIndentation - the leading whitespace of a line. May not be null.

pushSemanticIndentation

public void pushSemanticIndentation(java.lang.CharSequence completeIndentation)
Description copied from interface: IRichStringIndentationHandler
Announce semantic indentation. The passed indentation is expected to contain the complete whitespace prefix of a line. Implementors will extract the new parts from it automatically.

Specified by:
pushSemanticIndentation in interface IRichStringIndentationHandler
Parameters:
completeIndentation - the leading whitespace of a line. May not be null.

pushIndentation

protected void pushIndentation(java.lang.CharSequence completeIndentation)

popIndentation

public void popIndentation()
Description copied from interface: IRichStringIndentationHandler
Drop the recently announced indentation and use the previous state.

Specified by:
popIndentation in interface IRichStringIndentationHandler

accept

public void accept(IRichStringPartAcceptor acceptor)
Description copied from interface: IRichStringIndentationHandler
Announce the current indentation to the acceptor.

Specified by:
accept in interface IRichStringIndentationHandler

getTotalSemanticIndentation

public java.lang.CharSequence getTotalSemanticIndentation()
Description copied from interface: IRichStringIndentationHandler
Return the current semantic indentation.

Specified by:
getTotalSemanticIndentation in interface IRichStringIndentationHandler
Returns:
the complete semantic indentation. Never null.

getTotalIndentation

public java.lang.CharSequence getTotalIndentation()
Description copied from interface: IRichStringIndentationHandler
Return the current indentation.

Specified by:
getTotalIndentation in interface IRichStringIndentationHandler
Returns:
the complete indentation. Never null.