@Override public ETypedElement getEcoreTypedElement() { return getEcoreOperation(); }
@Override public ETypedElement getEcoreTypedElement() { return getEcoreOperation(); }
/** * @deprecated As of EMF 2.1, simply call <code>getEcoreTypedElement().getEType()</code>. */ @Deprecated protected EClassifier getReturn() { return getEcoreOperation().getEType(); }
@Override public String getName() { return getEcoreOperation().getName(); }
public boolean isVoid() { return getEcoreOperation().getEType() == null; }
/** * @deprecated As of EMF 2.1, simply call <code>getEcoreTypedElement().getEType()</code>. */ @Deprecated protected EClassifier getReturn() { return getEcoreOperation().getEType(); }
public boolean isVoid() { return getEcoreOperation().getEType() == null; }
public List<GenClassifier> getGenExceptions() { List<GenClassifier> result = new ArrayList<GenClassifier>(); for (EClassifier eClassifier : getEcoreOperation().getEExceptions()) { result.add(findGenClassifier(eClassifier)); } return result; }
public List<GenClassifier> getGenExceptions() { List<GenClassifier> result = new ArrayList<GenClassifier>(); for (EClassifier eClassifier : getEcoreOperation().getEExceptions()) { result.add(findGenClassifier(eClassifier)); } return result; }
public boolean hasCheckedException() { for (EClassifier eException : getEcoreOperation().getEExceptions()) { Class<?> eExceptionClass = eException.getInstanceClass(); if (eExceptionClass == null || !RuntimeException.class.isAssignableFrom(eExceptionClass)) { return true; } } return false; }
public String getThrows(GenClass context) { List<EGenericType> exceptions = getEcoreOperation().getEGenericExceptions(); if (exceptions.isEmpty()) { return ""; } else { StringBuilder result = new StringBuilder(" throws "); for (Iterator<EGenericType> i = exceptions.iterator(); i.hasNext(); ) { EGenericType exception = i.next(); result.append(getImportedType(context, exception, false)); if (i.hasNext()) { result.append(", "); } } return result.toString(); } }
protected String getBody() { EOperation eOperation = getEcoreOperation(); EAnnotation eAnnotation = eOperation.getEAnnotation(GenModelPackage.eNS_URI); return eAnnotation == null ? null : (String)eAnnotation.getDetails().get("body"); }
public boolean isSuppressedVisibility() { return isSetSuppressedVisibility() ? isSuppressedVisibilityGen() : EcoreUtil.isSuppressedVisibility(getEcoreOperation()); }
@Override public String getName() { EOperation ecoreOperation = getEcoreOperation(); return ecoreOperation == null || ecoreOperation.getName() == null ? "" : safeName(ecoreOperation.getName()); }
public boolean isInvariant() { String invariantValue = EcoreUtil.getAnnotation(getEcoreOperation(), EcorePackage.eNS_URI, "invariant"); if (invariantValue != null) { return "true".equals(invariantValue); } else { return "boolean".equals(getReturnType()) && getGenParameters().size() == 2 && "org.eclipse.emf.common.util.DiagnosticChain".equals ((getGenParameters().get(0)).getEcoreParameter().getEType().getInstanceClassName()) && "java.util.Map".equals ((getGenParameters().get(1)).getEcoreParameter().getEType().getInstanceClassName()); } }
protected String getInvariantExpression() { for (String validationDelegate : EcoreUtil.getValidationDelegates(getGenPackage().getEcorePackage())) { String expression = EcoreUtil.getAnnotation(getEcoreOperation(), validationDelegate, "body"); if (expression != null) { return expression; } } return null; }
public String getValidationDelegate() { for (String validationDelegate : EcoreUtil.getValidationDelegates(getGenPackage().getEcorePackage())) { String expression = EcoreUtil.getAnnotation(getEcoreOperation(), validationDelegate, "body"); if (expression != null) { return validationDelegate; } } return null; }
public boolean hasGenericExceptions() { if (getEffectiveComplianceLevel().getValue() >= GenJDKLevel.JDK50) { for (EGenericType eGenericType : getEcoreOperation().getEGenericExceptions()) { if (eGenericType.getETypeParameter() != null || !eGenericType.getETypeArguments().isEmpty()) { return true; } } } return false; }
public boolean hasGenericExceptions() { if (getEffectiveComplianceLevel().getValue() >= GenJDKLevel.JDK50) { for (EGenericType eGenericType : getEcoreOperation().getEGenericExceptions()) { if (eGenericType.getETypeParameter() != null || !eGenericType.getETypeArguments().isEmpty()) { return true; } } } return false; }
public boolean hasInvocationDelegate() { if (getGenModel().getRuntimeVersion().getValue() < GenRuntimeVersion.EMF26_VALUE) return false; EOperation ecoreOperation = getEcoreOperation(); for (String invocationDelegate : EcoreUtil.getInvocationDelegates(getGenPackage().getEcorePackage())) { if (ecoreOperation.getEAnnotation(invocationDelegate) != null) return true; } return false; }