Examples of JavaMethod


Examples of org.openquark.cal.internal.javamodel.JavaMethod

                    String javaFieldName = (String)typeConstructorInfo.fieldJavaNames.get(fieldName);
                    Set<JavaTypeName> fieldTypes = typeConstructorInfo.allFieldTypeNames.get(fieldName);
                   
                    for (JavaTypeName type  : fieldTypes) {
                        String accessorMethodName = (String)typeConstructorInfo.fieldJavaAccessorMethodNames.get(fieldName);
                        JavaMethod getter = createMethod_getField (
                                accessorMethodName,
                                javaFieldName,
                                type,
                                true);
                       
                        javaClassRep.addMethod(getter);
                       
                        getter.setJavaDocComment(new JavaDocComment ("@return " + fieldName));
                    }
                }
               
   
                javaClassRep.addMethod(createMethod_getDCName(typeConstructorInfo));
               
                javaClassRep.addMethod(createMethod_getDCOrdinal(typeConstructorInfo));
               
                JavaMethod toString = createMethod_toString();
                if (toString != null) {
                    javaClassRep.addMethod (toString);
                }
               
                if (typeConstructorInfo.isEnumerationType) {
                    JavaMethod equals = JavaDataClassGenerator.this.createMethod_equals(
                            typeConstructorClassName,
                            typeConstructorInfo.commonFieldNames,
                            typeConstructorInfo.commonFieldTypes);

                    javaClassRep.addMethod (equals);
View Full Code Here

Examples of org.rascalmpl.interpreter.result.JavaMethod

      if (!hasJavaModifier(this)) {
        throw new MissingModifier("java", this);
      }

      AbstractFunction lambda = new JavaMethod(__eval, this, varArgs,
          __eval.getCurrentEnvt(), __eval.__getJavaBridge());
      String name = org.rascalmpl.interpreter.utils.Names.name(this
          .getSignature().getName());
   
      __eval.getCurrentEnvt().storeFunction(name, lambda);
      __eval.getCurrentEnvt().markNameFinal(lambda.getName());
      __eval.getCurrentEnvt().markNameOverloadable(lambda.getName());

      lambda.setPublic(this.getVisibility().isPublic() || this.getVisibility().isDefault());
      return lambda;

    }
View Full Code Here

Examples of scriptingLanguage.variables.JavaMethod

    JavaClass<Parser> parserClass = new JavaClass<>("Parser", Parser.class);
    variables.put("parser", new Pair<AbstractClass<?>, Token>(parserClass, new Token(new JavaObject<>(parserClass, parser), Interpreter.variableType)));
    try {
      JavaClass<Method> methodClass = new JavaClass<>("Method", Method.class);
      variables.put("print:{Object}", new Pair<AbstractClass<?>, Token>(methodClass,
          new Token(new JavaMethod(JavaMethodClass.make(Interpreter.voidClass, Interpreter.ObjectClass), System.out.getClass().getMethod("print", Object.class), System.out, this), methodClass.getTokenType())));
      variables.put("println:{Object}", new Pair<AbstractClass<?>, Token>(methodClass,
          new Token(new JavaMethod(JavaMethodClass.make(Interpreter.voidClass, Interpreter.ObjectClass), System.out.getClass().getMethod("println", Object.class), System.out, this), methodClass.getTokenType())));
    }
    catch (NoSuchMethodException | SecurityException e) {
      e.printStackTrace();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.