org.eclipse.xtext.util
Class XtextSwitch<T>

java.lang.Object
  extended by org.eclipse.xtext.util.XtextSwitch<T>
Direct Known Subclasses:
AbstractContentProposalProvider.DefaultContentAssistProcessorSwitch, CodetemplatesProposalProvider.NestedContentAssistProcessorSwitch, CurrentTypeFinder.Implementation, DefaultTemplateProposalProvider.FollowElementAcceptor, GrammarElementTitleSwitch, GrammarWithoutLeftRecursionInspector, ParserBasedContentAssistContextFactory.CallHierarchyHelper, ParserBasedContentAssistContextFactory.FollowElementCalculator, PredicateUsesUnorderedGroupInspector, SLCommentPrefixCalculator, TerminalRuleToLexerBody, UsedRulesFinder, XtextRuleInspector

public class XtextSwitch<T>
extends java.lang.Object

The Switch for the model's inheritance hierarchy. It supports the call doSwitch(object) to invoke the caseXXX method for each class of the model, starting with the actual class of the object and proceeding up the inheritance hierarchy until a non-null result is returned, which is the result of the switch.

See Also:
XtextPackage
EMF generated code

Field Summary
protected static XtextPackage modelPackage
          The cached model package
 
Constructor Summary
XtextSwitch()
          Creates an instance of the switch
 
Method Summary
 T caseAbstractElement(AbstractElement object)
          Returns the result of interpreting the object as an instance of 'Abstract Element'
 T caseAbstractMetamodelDeclaration(AbstractMetamodelDeclaration object)
          Returns the result of interpreting the object as an instance of 'Abstract Metamodel Declaration'
 T caseAbstractNegatedToken(AbstractNegatedToken object)
          Returns the result of interpreting the object as an instance of 'Abstract Negated Token'
 T caseAbstractRule(AbstractRule object)
          Returns the result of interpreting the object as an instance of 'Abstract Rule'
 T caseAction(Action object)
          Returns the result of interpreting the object as an instance of 'Action'
 T caseAlternatives(Alternatives object)
          Returns the result of interpreting the object as an instance of 'Alternatives'
 T caseAssignment(Assignment object)
          Returns the result of interpreting the object as an instance of 'Assignment'
 T caseCharacterRange(CharacterRange object)
          Returns the result of interpreting the object as an instance of 'Character Range'
 T caseCompoundElement(CompoundElement object)
          Returns the result of interpreting the object as an instance of 'Compound Element'
 T caseCrossReference(CrossReference object)
          Returns the result of interpreting the object as an instance of 'Cross Reference'
 T caseEnumLiteralDeclaration(EnumLiteralDeclaration object)
          Returns the result of interpreting the object as an instance of 'Enum Literal Declaration'
 T caseEnumRule(EnumRule object)
          Returns the result of interpreting the object as an instance of 'Enum Rule'
 T caseEOF(EOF object)
          Returns the result of interpreting the object as an instance of 'EOF'
 T caseGeneratedMetamodel(GeneratedMetamodel object)
          Returns the result of interpreting the object as an instance of 'Generated Metamodel'
 T caseGrammar(Grammar object)
          Returns the result of interpreting the object as an instance of 'Grammar'
 T caseGroup(Group object)
          Returns the result of interpreting the object as an instance of 'Group'
 T caseKeyword(Keyword object)
          Returns the result of interpreting the object as an instance of 'Keyword'
 T caseNegatedToken(NegatedToken object)
          Returns the result of interpreting the object as an instance of 'Negated Token'
 T caseParserRule(ParserRule object)
          Returns the result of interpreting the object as an instance of 'Parser Rule'
 T caseReferencedMetamodel(ReferencedMetamodel object)
          Returns the result of interpreting the object as an instance of 'Referenced Metamodel'
 T caseRuleCall(RuleCall object)
          Returns the result of interpreting the object as an instance of 'Rule Call'
 T caseTerminalRule(TerminalRule object)
          Returns the result of interpreting the object as an instance of 'Terminal Rule'
 T caseTypeRef(TypeRef object)
          Returns the result of interpreting the object as an instance of 'Type Ref'
 T caseUnorderedGroup(UnorderedGroup object)
          Returns the result of interpreting the object as an instance of 'Unordered Group'
 T caseUntilToken(UntilToken object)
          Returns the result of interpreting the object as an instance of 'Until Token'
 T caseWildcard(Wildcard object)
          Returns the result of interpreting the object as an instance of 'Wildcard'
 T defaultCase(org.eclipse.emf.ecore.EObject object)
          Returns the result of interpreting the object as an instance of 'EObject'
protected  T doSwitch(org.eclipse.emf.ecore.EClass theEClass, org.eclipse.emf.ecore.EObject theEObject)
          Calls caseXXX for each class of the model until one returns a non null result; it yields that result
 T doSwitch(org.eclipse.emf.ecore.EObject theEObject)
          Calls caseXXX for each class of the model until one returns a non null result; it yields that result
protected  T doSwitch(int classifierID, org.eclipse.emf.ecore.EObject theEObject)
          Calls caseXXX for each class of the model until one returns a non null result; it yields that result
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelPackage

protected static XtextPackage modelPackage
The cached model package

EMF generated code
Constructor Detail

XtextSwitch

public XtextSwitch()
Creates an instance of the switch.

EMF generated code
Method Detail

doSwitch

public T doSwitch(org.eclipse.emf.ecore.EObject theEObject)
Calls caseXXX for each class of the model until one returns a non null result; it yields that result.

Returns:
the first non-null result returned by a caseXXX call.
EMF generated code

doSwitch

protected T doSwitch(org.eclipse.emf.ecore.EClass theEClass,
                     org.eclipse.emf.ecore.EObject theEObject)
Calls caseXXX for each class of the model until one returns a non null result; it yields that result.

Returns:
the first non-null result returned by a caseXXX call.
EMF generated code

doSwitch

protected T doSwitch(int classifierID,
                     org.eclipse.emf.ecore.EObject theEObject)
Calls caseXXX for each class of the model until one returns a non null result; it yields that result.

Returns:
the first non-null result returned by a caseXXX call.
EMF generated code

caseGrammar

public T caseGrammar(Grammar object)
Returns the result of interpreting the object as an instance of 'Grammar'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Grammar'.
See Also:
doSwitch(EObject)
EMF generated code

caseAbstractRule

public T caseAbstractRule(AbstractRule object)
Returns the result of interpreting the object as an instance of 'Abstract Rule'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Abstract Rule'.
See Also:
doSwitch(EObject)
EMF generated code

caseAbstractMetamodelDeclaration

public T caseAbstractMetamodelDeclaration(AbstractMetamodelDeclaration object)
Returns the result of interpreting the object as an instance of 'Abstract Metamodel Declaration'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Abstract Metamodel Declaration'.
See Also:
doSwitch(EObject)
EMF generated code

caseGeneratedMetamodel

public T caseGeneratedMetamodel(GeneratedMetamodel object)
Returns the result of interpreting the object as an instance of 'Generated Metamodel'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Generated Metamodel'.
See Also:
doSwitch(EObject)
EMF generated code

caseReferencedMetamodel

public T caseReferencedMetamodel(ReferencedMetamodel object)
Returns the result of interpreting the object as an instance of 'Referenced Metamodel'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Referenced Metamodel'.
See Also:
doSwitch(EObject)
EMF generated code

caseParserRule

public T caseParserRule(ParserRule object)
Returns the result of interpreting the object as an instance of 'Parser Rule'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Parser Rule'.
See Also:
doSwitch(EObject)
EMF generated code

caseTypeRef

public T caseTypeRef(TypeRef object)
Returns the result of interpreting the object as an instance of 'Type Ref'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Type Ref'.
See Also:
doSwitch(EObject)
EMF generated code

caseAbstractElement

public T caseAbstractElement(AbstractElement object)
Returns the result of interpreting the object as an instance of 'Abstract Element'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Abstract Element'.
See Also:
doSwitch(EObject)
EMF generated code

caseAction

public T caseAction(Action object)
Returns the result of interpreting the object as an instance of 'Action'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Action'.
See Also:
doSwitch(EObject)
EMF generated code

caseKeyword

public T caseKeyword(Keyword object)
Returns the result of interpreting the object as an instance of 'Keyword'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Keyword'.
See Also:
doSwitch(EObject)
EMF generated code

caseRuleCall

public T caseRuleCall(RuleCall object)
Returns the result of interpreting the object as an instance of 'Rule Call'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Rule Call'.
See Also:
doSwitch(EObject)
EMF generated code

caseAssignment

public T caseAssignment(Assignment object)
Returns the result of interpreting the object as an instance of 'Assignment'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Assignment'.
See Also:
doSwitch(EObject)
EMF generated code

caseCrossReference

public T caseCrossReference(CrossReference object)
Returns the result of interpreting the object as an instance of 'Cross Reference'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cross Reference'.
See Also:
doSwitch(EObject)
EMF generated code

caseTerminalRule

public T caseTerminalRule(TerminalRule object)
Returns the result of interpreting the object as an instance of 'Terminal Rule'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Terminal Rule'.
See Also:
doSwitch(EObject)
EMF generated code

caseAbstractNegatedToken

public T caseAbstractNegatedToken(AbstractNegatedToken object)
Returns the result of interpreting the object as an instance of 'Abstract Negated Token'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Abstract Negated Token'.
See Also:
doSwitch(EObject)
EMF generated code

caseNegatedToken

public T caseNegatedToken(NegatedToken object)
Returns the result of interpreting the object as an instance of 'Negated Token'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Negated Token'.
See Also:
doSwitch(EObject)
EMF generated code

caseUntilToken

public T caseUntilToken(UntilToken object)
Returns the result of interpreting the object as an instance of 'Until Token'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Until Token'.
See Also:
doSwitch(EObject)
EMF generated code

caseWildcard

public T caseWildcard(Wildcard object)
Returns the result of interpreting the object as an instance of 'Wildcard'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Wildcard'.
See Also:
doSwitch(EObject)
EMF generated code

caseEOF

public T caseEOF(EOF object)
Returns the result of interpreting the object as an instance of 'EOF'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'EOF'.
Since:
2.0
See Also:
doSwitch(EObject)
EMF generated code

caseEnumRule

public T caseEnumRule(EnumRule object)
Returns the result of interpreting the object as an instance of 'Enum Rule'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Enum Rule'.
See Also:
doSwitch(EObject)
EMF generated code

caseEnumLiteralDeclaration

public T caseEnumLiteralDeclaration(EnumLiteralDeclaration object)
Returns the result of interpreting the object as an instance of 'Enum Literal Declaration'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Enum Literal Declaration'.
See Also:
doSwitch(EObject)
EMF generated code

caseAlternatives

public T caseAlternatives(Alternatives object)
Returns the result of interpreting the object as an instance of 'Alternatives'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Alternatives'.
See Also:
doSwitch(EObject)
EMF generated code

caseUnorderedGroup

public T caseUnorderedGroup(UnorderedGroup object)
Returns the result of interpreting the object as an instance of 'Unordered Group'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Unordered Group'.
See Also:
doSwitch(EObject)
EMF generated code

caseGroup

public T caseGroup(Group object)
Returns the result of interpreting the object as an instance of 'Group'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Group'.
See Also:
doSwitch(EObject)
EMF generated code

caseCharacterRange

public T caseCharacterRange(CharacterRange object)
Returns the result of interpreting the object as an instance of 'Character Range'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Character Range'.
See Also:
doSwitch(EObject)
EMF generated code

caseCompoundElement

public T caseCompoundElement(CompoundElement object)
Returns the result of interpreting the object as an instance of 'Compound Element'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Compound Element'.
See Also:
doSwitch(EObject)
EMF generated code

defaultCase

public T defaultCase(org.eclipse.emf.ecore.EObject object)
Returns the result of interpreting the object as an instance of 'EObject'. This implementation returns null; returning a non-null result will terminate the switch, but this is the last case anyway.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'EObject'.
See Also:
doSwitch(org.eclipse.emf.ecore.EObject)
EMF generated code