public class QueryTranslator extends BaseTranslator
logger
Constructor and Description |
---|
QueryTranslator() |
Modifier and Type | Method and Description |
---|---|
void |
handleDotOperation(String translation,
Object node) |
void |
handleIncludes(String translation,
Object node) |
void |
handleIsLike(String translation,
Object node) |
void |
handleLogicalExpression(String translation,
Object node) |
void |
handleRelationalExpression(String translation,
Object node) |
void |
handleSelect(String translation,
Object node) |
void |
handleSortedBy(String translation,
Object node) |
void |
handleSubSelect(String translation,
Object node) |
void |
inAFeatureCall(AFeatureCall expression)
Override to handle any featureCall expressions ( i.e.
|
void |
inALogicalExpressionTail(ALogicalExpressionTail logicalExpressionTail)
Override to deal with logical 'and, 'or', 'xor, ...
|
void |
inAParenthesesPrimaryExpression(AParenthesesPrimaryExpression expression)
Override to deal with entering parenthesis expressions '(
|
void |
inAPropertyCallExpression(APropertyCallExpression expression)
Override to handle any propertyCall expressions ( i.e.
|
void |
inARelationalExpressionTail(ARelationalExpressionTail relationalExpressionTail)
Override to deal with relational ' <, '>', '=', ...
|
void |
inAStandardDeclarator(AStandardDeclarator declarator)
Helps out with 'includesAll', replaces the {1} in the expression fragment when a declarator is encountered (i.e.
|
protected boolean |
isInitialDeclarator()
True/false whether or not its the initial declarator.
|
void |
outAParenthesesPrimaryExpression(AParenthesesPrimaryExpression expression)
Override to deal with leaving parenthesis expressions '(
|
void |
postProcess()
Handles any final processing.
|
void |
preProcess()
Called by super class to reset any objects.
|
protected String |
replaceFragment(String fragment,
String replacement,
int index)
Checks to see if the replacement is an argument and if so replaces the {index} in the fragment with the
'argument' fragment from the template.
|
getContextElement, getExpression, getOperation, getTranslationFragment, handleTranslationFragment, inAClassifierContextDeclaration, inADefClassifierExpressionBody, inAInvClassifierExpressionBody, inAOperationContextDeclaration, inAOperationExpressionBody, isOperationArgument, process, translate
caseAActualParameterList, caseAAdditiveExpression, caseAAdditiveExpressionTail, caseAAndLogicalOperator, caseAArrowPropertyCallExpressionTail, caseAAttributeOrAssociationContextDeclaration, caseAAttributeOrAssociationExpressionBody, caseABagCollectionKind, caseABagCollectionType, caseABarFeatureCallParameterOption, caseABodyOperationStereotype, caseABooleanPrimitiveLit, caseAClassifierContextDeclaration, caseACollectionCollectionKind, caseACollectionCollectionType, caseACollectionLit, caseACollectionLiteral, caseACollectionType, caseAColonFeatureCallParameterOption, caseACommaExpression, caseACommaFeatureCallParameterOption, caseAConcreteFeatureCallParameters, caseAContextDeclaration, caseADeclaratorTail, caseADefClassifierExpressionBody, caseADeriveInitialOrDerivedValue, caseADivMultiplyOperator, caseADotPropertyCallExpressionTail, caseAEqualExpression, caseAEqualRelationalOperator, caseAExpMessageArgument, caseAExpressionListOrRange, caseAFeatureCall, caseAFeatureCallParameters, caseAFeaturePrimaryExpression, caseAGteqRelationalOperator, caseAGtRelationalOperator, caseAIfExpression, caseAIfPrimaryExpression, caseAImpliesLogicalOperator, caseAInitInitialOrDerivedValue, caseAInLetExpSub, caseAIntegerPrimitiveLit, caseAInvClassifierExpressionBody, caseAIsMarkedPre, caseAIsSentMessageExp, caseAIterateDeclarator, caseAIterateFeatureCallParameterOption, caseALetExp, caseALetExpression, caseALetVariableDeclaration, caseAListExpressionListOrRangeTail, caseALiteralPrimaryExpression, caseALogicalExp, caseALogicalExpression, caseALogicalExpressionTail, caseALteqRelationalOperator, caseALtRelationalOperator, caseAMessageArguments, caseAMessageArgumentsTail, caseAMessageExpression, caseAMessageMessageExp, caseAMinusAddOperator, caseAMinusUnaryOperator, caseAMultiplicativeExpression, caseAMultiplicativeExpressionTail, caseAMultMultiplyOperator, caseANotEqualRelationalOperator, caseANotUnaryOperator, caseAOperation, caseAOperationContextDeclaration, caseAOperationDefinitionExpression, caseAOperationExpressionBody, caseAOrderedsetCollectionType, caseAOrLogicalOperator, caseAPackageDeclaration, caseAParenthesesPrimaryExpression, caseAPathName, caseAPathNameTail, caseAPlusAddOperator, caseAPostOperationStereotype, caseAPreOperationStereotype, caseAPrimitiveLiteral, caseAPropertyCallExpression, caseAQualifiers, caseARangeExpressionListOrRangeTail, caseARealPrimitiveLit, caseARelationalExpression, caseARelationalExpressionTail, caseAScopeOperatorName, caseASequenceCollectionKind, caseASequenceCollectionType, caseASetCollectionKind, caseASetCollectionType, caseASimpleType, caseAStandardDeclarator, caseAStringPrimitiveLit, caseATupleLit, caseATupleLiteral, caseATupleType, caseATupletypeType, caseATypeDeclaration, caseATypeMessageArgument, caseAUnaryExpression, caseAVariableDeclaration, caseAVariableDeclarationLetExpSub, caseAVariableDeclarationList, caseAVariableDeclarationListTail, caseAVariableDefinitionExpression, caseAXorLogicalOperator, caseStart, defaultIn, defaultOut, inAActualParameterList, inAAdditiveExpression, inAAdditiveExpressionTail, inAAndLogicalOperator, inAArrowPropertyCallExpressionTail, inAAttributeOrAssociationContextDeclaration, inAAttributeOrAssociationExpressionBody, inABagCollectionKind, inABagCollectionType, inABarFeatureCallParameterOption, inABodyOperationStereotype, inABooleanPrimitiveLit, inACollectionCollectionKind, inACollectionCollectionType, inACollectionLit, inACollectionLiteral, inACollectionType, inAColonFeatureCallParameterOption, inACommaExpression, inACommaFeatureCallParameterOption, inAConcreteFeatureCallParameters, inAContextDeclaration, inADeclaratorTail, inADeriveInitialOrDerivedValue, inADivMultiplyOperator, inADotPropertyCallExpressionTail, inAEqualExpression, inAEqualRelationalOperator, inAExpMessageArgument, inAExpressionListOrRange, inAFeatureCallParameters, inAFeaturePrimaryExpression, inAGteqRelationalOperator, inAGtRelationalOperator, inAIfExpression, inAIfPrimaryExpression, inAImpliesLogicalOperator, inAInitInitialOrDerivedValue, inAInLetExpSub, inAIntegerPrimitiveLit, inAIsMarkedPre, inAIsSentMessageExp, inAIterateDeclarator, inAIterateFeatureCallParameterOption, inALetExp, inALetExpression, inALetVariableDeclaration, inAListExpressionListOrRangeTail, inALiteralPrimaryExpression, inALogicalExp, inALogicalExpression, inALteqRelationalOperator, inALtRelationalOperator, inAMessageArguments, inAMessageArgumentsTail, inAMessageExpression, inAMessageMessageExp, inAMinusAddOperator, inAMinusUnaryOperator, inAMultiplicativeExpression, inAMultiplicativeExpressionTail, inAMultMultiplyOperator, inANotEqualRelationalOperator, inANotUnaryOperator, inAOperation, inAOperationDefinitionExpression, inAOrderedsetCollectionType, inAOrLogicalOperator, inAPackageDeclaration, inAPathName, inAPathNameTail, inAPlusAddOperator, inAPostOperationStereotype, inAPreOperationStereotype, inAPrimitiveLiteral, inAQualifiers, inARangeExpressionListOrRangeTail, inARealPrimitiveLit, inARelationalExpression, inAScopeOperatorName, inASequenceCollectionKind, inASequenceCollectionType, inASetCollectionKind, inASetCollectionType, inASimpleType, inAStringPrimitiveLit, inATupleLit, inATupleLiteral, inATupleType, inATupletypeType, inATypeDeclaration, inATypeMessageArgument, inAUnaryExpression, inAVariableDeclaration, inAVariableDeclarationLetExpSub, inAVariableDeclarationList, inAVariableDeclarationListTail, inAVariableDefinitionExpression, inAXorLogicalOperator, inStart, outAActualParameterList, outAAdditiveExpression, outAAdditiveExpressionTail, outAAndLogicalOperator, outAArrowPropertyCallExpressionTail, outAAttributeOrAssociationContextDeclaration, outAAttributeOrAssociationExpressionBody, outABagCollectionKind, outABagCollectionType, outABarFeatureCallParameterOption, outABodyOperationStereotype, outABooleanPrimitiveLit, outAClassifierContextDeclaration, outACollectionCollectionKind, outACollectionCollectionType, outACollectionLit, outACollectionLiteral, outACollectionType, outAColonFeatureCallParameterOption, outACommaExpression, outACommaFeatureCallParameterOption, outAConcreteFeatureCallParameters, outAContextDeclaration, outADeclaratorTail, outADefClassifierExpressionBody, outADeriveInitialOrDerivedValue, outADivMultiplyOperator, outADotPropertyCallExpressionTail, outAEqualExpression, outAEqualRelationalOperator, outAExpMessageArgument, outAExpressionListOrRange, outAFeatureCall, outAFeatureCallParameters, outAFeaturePrimaryExpression, outAGteqRelationalOperator, outAGtRelationalOperator, outAIfExpression, outAIfPrimaryExpression, outAImpliesLogicalOperator, outAInitInitialOrDerivedValue, outAInLetExpSub, outAIntegerPrimitiveLit, outAInvClassifierExpressionBody, outAIsMarkedPre, outAIsSentMessageExp, outAIterateDeclarator, outAIterateFeatureCallParameterOption, outALetExp, outALetExpression, outALetVariableDeclaration, outAListExpressionListOrRangeTail, outALiteralPrimaryExpression, outALogicalExp, outALogicalExpression, outALogicalExpressionTail, outALteqRelationalOperator, outALtRelationalOperator, outAMessageArguments, outAMessageArgumentsTail, outAMessageExpression, outAMessageMessageExp, outAMinusAddOperator, outAMinusUnaryOperator, outAMultiplicativeExpression, outAMultiplicativeExpressionTail, outAMultMultiplyOperator, outANotEqualRelationalOperator, outANotUnaryOperator, outAOperation, outAOperationContextDeclaration, outAOperationDefinitionExpression, outAOperationExpressionBody, outAOrderedsetCollectionType, outAOrLogicalOperator, outAPackageDeclaration, outAPathName, outAPathNameTail, outAPlusAddOperator, outAPostOperationStereotype, outAPreOperationStereotype, outAPrimitiveLiteral, outAPropertyCallExpression, outAQualifiers, outARangeExpressionListOrRangeTail, outARealPrimitiveLit, outARelationalExpression, outARelationalExpressionTail, outAScopeOperatorName, outASequenceCollectionKind, outASequenceCollectionType, outASetCollectionKind, outASetCollectionType, outASimpleType, outAStandardDeclarator, outAStringPrimitiveLit, outATupleLit, outATupleLiteral, outATupleType, outATupletypeType, outATypeDeclaration, outATypeMessageArgument, outAUnaryExpression, outAVariableDeclaration, outAVariableDeclarationLetExpSub, outAVariableDeclarationList, outAVariableDeclarationListTail, outAVariableDefinitionExpression, outAXorLogicalOperator, outStart
caseEOF, caseTAnd, caseTApostrophe, caseTArrow, caseTAttr, caseTBag, caseTBar, caseTBlank, caseTBody, caseTBoolean, caseTCollection, caseTColon, caseTComma, caseTCommercialAt, caseTContext, caseTDef, caseTDerive, caseTDiv, caseTDot, caseTElse, caseTEndif, caseTEndpackage, caseTEnum, caseTEqual, caseTGt, caseTGteq, caseTIf, caseTImplies, caseTIn, caseTInit, caseTInt, caseTInv, caseTIsSentOperator, caseTLBrace, caseTLBracket, caseTLet, caseTLParen, caseTLt, caseTLteq, caseTMessageOperator, caseTMinus, caseTMult, caseTMultiLineComment, caseTName, caseTNewLine, caseTNot, caseTNotEqual, caseTOper, caseTOr, caseTOrderedset, caseTPackage, caseTPlus, caseTPost, caseTPre, caseTRange, caseTRBrace, caseTRBracket, caseTReal, caseTRParen, caseTScopeOperator, caseTSemicolon, caseTSequence, caseTSet, caseTSingleLineComment, caseTStringLit, caseTTab, caseTThen, caseTTuple, caseTTupletype, caseTUnknown, caseTXor, defaultCase, getIn, getOut, setIn, setOut
public QueryTranslator()
public void preProcess()
preProcess
in class BaseTranslator
protected boolean isInitialDeclarator()
public void inAStandardDeclarator(AStandardDeclarator declarator)
inAStandardDeclarator
in class DepthFirstAdapter
declarator
- public void inAPropertyCallExpression(APropertyCallExpression expression)
inAPropertyCallExpression
in class DepthFirstAdapter
expression
- BaseTranslator.handleTranslationFragment(Object)
public void inAFeatureCall(AFeatureCall expression)
inAFeatureCall
in class DepthFirstAdapter
expression
- BaseTranslator.handleTranslationFragment(Object)
public void inALogicalExpressionTail(ALogicalExpressionTail logicalExpressionTail)
inALogicalExpressionTail
in class DepthFirstAdapter
logicalExpressionTail
- BaseTranslator.handleTranslationFragment(Object)
public void inARelationalExpressionTail(ARelationalExpressionTail relationalExpressionTail)
inARelationalExpressionTail
in class DepthFirstAdapter
relationalExpressionTail
- BaseTranslator.handleTranslationFragment(Object)
public void inAParenthesesPrimaryExpression(AParenthesesPrimaryExpression expression)
inAParenthesesPrimaryExpression
in class DepthFirstAdapter
expression
- Expression.appendToTranslatedExpression(Object)
public void outAParenthesesPrimaryExpression(AParenthesesPrimaryExpression expression)
outAParenthesesPrimaryExpression
in class DepthFirstAdapter
expression
- Expression.appendToTranslatedExpression(Object)
protected String replaceFragment(String fragment, String replacement, int index)
fragment
- the fragment to perform replacement.replacement
- the replacement stringindex
- the index in the string to replace.public void postProcess()
postProcess
in class BaseTranslator
public void handleSubSelect(String translation, Object node)
translation
- node
- public void handleIsLike(String translation, Object node)
translation
- node
- public void handleSelect(String translation, Object node)
translation
- node
- public void handleIncludes(String translation, Object node)
translation
- node
- public void handleDotOperation(String translation, Object node)
translation
- node
- public void handleSortedBy(String translation, Object node)
translation
- node
- public void handleLogicalExpression(String translation, Object node)
translation
- node
- public void handleRelationalExpression(String translation, Object node)
translation
- node
- Copyright © 2003–2014 AndroMDA.org. All rights reserved.