/** * From a given name, other variants are computed, e.g. the name may be a property name * such as a prefix may be added to the name. Or it may be an operator such as the original * method name should be used, too, to find a declaration. */ @Override protected void processFeatureNames(QualifiedName name, NameAcceptor acceptor) { QualifiedName methodName = operatorMapping == null? null : operatorMapping.getMethodName(name); if (methodName != null) { acceptor.accept(methodName.toString(), 2); QualifiedName simpleOperator = operatorMapping.getSimpleOperator(name); if (simpleOperator != null) { QualifiedName simpleMethodName = operatorMapping.getMethodName(simpleOperator); if (simpleMethodName != null) { acceptor.accept(simpleMethodName.toString(), 3); } } } else { acceptor.accept(name.toString(), 1); processAsPropertyNames(name, acceptor); } }
/** * Considers the given name to be a property name. If the concrete syntax of the * processed feature matches a feature call or assignment, a prefix is added to the * name and that one is used as a variant that should be processed. */ protected void processAsPropertyNames(QualifiedName name, NameAcceptor acceptor) { String nameAsPropertyName = tryGetAsPropertyName(name.toString()); if (nameAsPropertyName != null) { if (featureCall == null || featureCall instanceof XAssignment) { String aliasedSetter = "set" + nameAsPropertyName; acceptor.accept(aliasedSetter, 2); } if (!(featureCall instanceof XAssignment)) { if (featureCall == null || !getFeatureCall().isExplicitOperationCallOrBuilderSyntax()) { String aliasedGetter = "get" + nameAsPropertyName; acceptor.accept(aliasedGetter, 2); String aliasedBooleanGetter = "is" + nameAsPropertyName; acceptor.accept(aliasedBooleanGetter, 2); } } } }
protected void processFeatureNames(QualifiedName name, NameAcceptor acceptor) { acceptor.accept(name.toString(), 1); }