public static void main(String args[]) {

    AClass aObject = new AClass();
    DClass dObject = new DClass();

    System.out.println("Call 1 - calling a1method with 2 as input");
    String output = aObject.a1method("2.0");
    System.out.println("Output = " + output);

    System.out.println("\n\nCall 2 - calling d2method with 5.0 as input");
    output = dObject.d2method("5.0");
    System.out.println("Output = " + output);
  }
Пример #2
0
  public static void printConstructors(AClass aClass) {
    Class c = aClass.getClass();
    // 获取指定类的类名
    String className = c.getName();
    try {
      // 获取指定类的构造方法
      Constructor[] theConstructors = c.getConstructors();
      for (int i = 0; i < theConstructors.length; i++) {
        // 获取指定构造方法的参数的集合
        Class[] parameterTypes = theConstructors[i].getParameterTypes();

        System.out.print(className + "(");

        for (int j = 0; j < parameterTypes.length; j++)
          System.out.print(parameterTypes[j].getName() + " ");

        System.out.println(")");
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
 public static void main(String[] args) {
   AClass.invokedByExternalIntegrationTest();
 }
 @Test
 public void simpleIntegrationTest() {
   AClass.invokedByIntegrationTest();
 }
Пример #5
0
 void appendReturnType(IndentingStringWriter writer) throws IOException {
   returnType.appendSource(writer);
   writer.append(" ");
 }
Пример #6
0
 public Set<AClass> getImports() {
   Set<AClass> imports = extractImportsFrom(annotations, parameters, exceptions);
   imports.addAll(returnType.getImports());
   return imports;
 }
Пример #7
0
 @Override
 public String encode(AClass aClass) throws EncodeException {
   return aClass.toString();
 }