protected JvmOperation createMethodProxy(Method method) { JvmOperation proxy = operationProxies.get(method); if (proxy == null) { proxy = TypesFactory.eINSTANCE.createJvmOperation(); URI uri = uriHelper.getFullURI(method); ((InternalEObject)proxy).eSetProxyURI(uri); operationProxies.put(method, proxy); } return proxy; }
protected JvmOperation createMethodProxy(Method method) { JvmOperation proxy = operationProxies.get(method); if (proxy == null) { proxy = TypesFactory.eINSTANCE.createJvmOperation(); URI uri = uriHelper.getFullURI(method); ((InternalEObject)proxy).eSetProxyURI(uri); operationProxies.put(method, proxy); } return proxy; }
protected JvmOperation createMethodProxy(BinaryTypeSignature type, String methodName) { BinarySimpleMemberSignature method = type.appendMethod(methodName); JvmOperation proxy = operationProxies.get(method); if (proxy == null) { proxy = TypesFactory.eINSTANCE.createJvmOperation(); URI uri = method.getURI(); ((InternalEObject) proxy).eSetProxyURI(uri); operationProxies.put(method, proxy); } return proxy; }
protected JvmOperation createOperation(Method method) { JvmOperation result = TypesFactory.eINSTANCE.createJvmOperation(); Type[] genericParameterTypes = null; try {
@Override public MutableAnnotationTypeElementDeclaration addAnnotationTypeElement(final String name, final Procedure1<MutableAnnotationTypeElementDeclaration> initializer) { this.checkMutable(); ConditionUtils.checkJavaIdentifier(name, "name"); Preconditions.checkArgument((initializer != null), "initializer cannot be null"); final JvmOperation newAnnotationElement = TypesFactory.eINSTANCE.createJvmOperation(); newAnnotationElement.setSimpleName(name); newAnnotationElement.setVisibility(JvmVisibility.PUBLIC); this.getDelegate().getMembers().add(newAnnotationElement); MemberDeclaration _memberDeclaration = this.getCompilationUnit().toMemberDeclaration(newAnnotationElement); final MutableAnnotationTypeElementDeclaration mutableAnnotationTypeElementDeclaration = ((MutableAnnotationTypeElementDeclaration) _memberDeclaration); initializer.apply(mutableAnnotationTypeElementDeclaration); return mutableAnnotationTypeElementDeclaration; }
protected JvmOperation createOperation(Method method) { JvmOperation result = TypesFactory.eINSTANCE.createJvmOperation(); Type[] genericParameterTypes = null; try {
this.offset = initialOffset; } else { JvmOperation operation = TypesFactory.eINSTANCE.createJvmOperation(); result = operation; String declaratorIdentifier = declarator.getIdentifier();
/** * Creates a public method with the given name and the given return type and associates it with the given * sourceElement. * * @param sourceElement * the sourceElement the method should be associated with. * @param name * the simple name of the method to be created. * @param returnType * the return type of the created method. * @param initializer * the initializer to apply on the created method. If <code>null</code>, the method won't be initialized. * * @return a result representing a Java method with the given name, <code>null</code> if sourceElement or name are <code>null</code>. */ /* @Nullable */ public JvmOperation toMethod(/* @Nullable */ EObject sourceElement, /* @Nullable */ String name, /* @Nullable */ JvmTypeReference returnType, /* @Nullable */ Procedure1<? super JvmOperation> initializer) { if(sourceElement == null || name == null) return null; JvmOperation result = typesFactory.createJvmOperation(); result.setSimpleName(name); result.setVisibility(JvmVisibility.PUBLIC); result.setReturnType(cloneWithProxies(returnType)); associate(sourceElement, result); return initializeSafely(result, initializer); }
return null; JvmOperation first = iterator.next(); JvmOperation result = typesFactory.createJvmOperation(); target.getMembers().add(result); for (int i = 0; i < first.getParameters().size(); i++) {
public MutableMethodDeclaration addMethod(final String name, final Procedure1<MutableMethodDeclaration> initializer) { this.checkMutable(); ConditionUtils.checkJavaIdentifier(name, "name"); Preconditions.checkArgument((initializer != null), "initializer cannot be null"); final JvmOperation newMethod = TypesFactory.eINSTANCE.createJvmOperation(); newMethod.setVisibility(JvmVisibility.PUBLIC); newMethod.setSimpleName(name); newMethod.setReturnType(this.getCompilationUnit().toJvmTypeReference(this.getCompilationUnit().getTypeReferenceProvider().getPrimitiveVoid())); this.getDelegate().getMembers().add(newMethod); MemberDeclaration _memberDeclaration = this.getCompilationUnit().toMemberDeclaration(newMethod); final MutableMethodDeclaration mutableMethodDeclaration = ((MutableMethodDeclaration) _memberDeclaration); initializer.apply(mutableMethodDeclaration); return mutableMethodDeclaration; }
JvmOperation values = typesFactory.createJvmOperation(); values.setVisibility(JvmVisibility.PUBLIC); values.setStatic(true); JvmOperation valueOf = typesFactory.createJvmOperation(); valueOf.setVisibility(JvmVisibility.PUBLIC); valueOf.setStatic(true);
@Override public MutableMethodDeclaration addMethod(final String name, final Procedure1<MutableMethodDeclaration> initializer) { this.checkMutable(); ConditionUtils.checkJavaIdentifier(name, "name"); Preconditions.checkArgument((initializer != null), "initializer cannot be null"); final JvmOperation newMethod = TypesFactory.eINSTANCE.createJvmOperation(); newMethod.setVisibility(JvmVisibility.PUBLIC); newMethod.setSimpleName(name); newMethod.setReturnType(this.getCompilationUnit().toJvmTypeReference(this.getCompilationUnit().getTypeReferenceProvider().getPrimitiveVoid())); newMethod.setAbstract(true); this.getDelegate().getMembers().add(newMethod); MemberDeclaration _memberDeclaration = this.getCompilationUnit().toMemberDeclaration(newMethod); final MutableMethodDeclaration mutableMethodDeclaration = ((MutableMethodDeclaration) _memberDeclaration); initializer.apply(mutableMethodDeclaration); return mutableMethodDeclaration; }
if(sourceElement == null || propertyName == null || fieldName == null) return null; JvmOperation result = typesFactory.createJvmOperation(); result.setVisibility(JvmVisibility.PUBLIC); result.setReturnType(references.getTypeForName(Void.TYPE,sourceElement));
if(sourceElement == null || propertyName == null || fieldName == null) return null; JvmOperation result = typesFactory.createJvmOperation(); result.setVisibility(JvmVisibility.PUBLIC); String prefix = (isPrimitiveBoolean(typeRef) ? "is" : "get");
container.getMembers().add(cacheVar); JvmOperation initializer = typesFactory.createJvmOperation(); container.getMembers().add(initializer); initializer.setSimpleName(CREATE_INITIALIZER_PREFIX + source.getName());
operation.getSimpleName(), types); if (createdActions.add(actSigKey)) { final JvmOperation newOp = this.typesFactory.createJvmOperation(); target.getMembers().add(newOp);
final JvmOperation operation = this.typesFactory.createJvmOperation(); container.getMembers().add(operation); operation.setVisibility(JvmVisibility.PRIVATE);
final JvmOperation operation = this.typesFactory.createJvmOperation();
XtendField field = (XtendField) member; if (!Strings.isEmpty(field.getName())) { JvmOperation operation = typesFactory.createJvmOperation(); associator.associatePrimary(member, operation); operation.setSimpleName(field.getName());
protected void transform(XtendFunction source, JvmGenericType container, boolean allowDispatch) { JvmOperation operation = typesFactory.createJvmOperation(); operation.setAbstract(source.isAbstract()); operation.setNative(source.isNative());