Package com.dragome.compiler.units

Examples of com.dragome.compiler.units.ClassUnit


    return getClassUnit(signature);
  }

  public ClassUnit getOrCreateClassUnit(String className)
  {
    ClassUnit classUnit= classesByName.get(className);
    if (classUnit != null)
      return classUnit;

    Signature signature= Project.singleton.getSignature(className);
    classUnit= new ClassUnit(this, signature);
    classesByName.put(className, classUnit);

    if (className.equals("java.lang.Object"))
    {
      javaLangObject= classUnit;
View Full Code Here


    return classUnit;
  }

  private MemberUnit getMemberUnitOrNull(String className, Signature signature)
  {
    ClassUnit classUnit= getOrCreateClassUnit(className);
    if (classUnit == null)
      return null;
    return classUnit.getDeclaredMember(signature.toString());
  }
View Full Code Here

  {
    MemberUnit member= getMemberUnitOrNull(className, signature);

    if (member == null)
    {
      ClassUnit clazz= getClassUnit(className);
      if (signature.isMethod())
      {
        member= new MethodUnit(signature, clazz, nameAndSignature);
      }
      else if (signature.isConstructor())
View Full Code Here

    if (!type.getClassName().equals("java.lang.Object"))
    {

      ObjectType superType= new ObjectType(jc.getSuperclassName());
      typeDecl.setSuperType(superType);
      ClassUnit superUnit= Project.getSingleton().getOrCreateClassUnit(superType.getClassName());
      fileUnit.setSuperUnit(superUnit);

      String[] interfaceNames= jc.getInterfaceNames();
      for (int i= 0; i < interfaceNames.length; i++)
      {
        ObjectType interfaceType= new ObjectType(interfaceNames[i]);
        ClassUnit interfaceUnit= Project.getSingleton().getOrCreateClassUnit(interfaceType.getClassName());
        fileUnit.addInterface(interfaceUnit);
      }
    }

    Field[] fields= jc.getFields();
View Full Code Here

  {
    String className= args[0];
    DragomeJsCompiler.compiler= new DragomeJsCompiler(CompilerType.Standard);

    Project.createSingleton(null);
    ClassUnit classUnit= new ClassUnit(Project.singleton, Project.singleton.getSignature(className));
    classUnit.setClassFile(new FileObject(new File(args[1])));
    Parser parser= new Parser(classUnit);
    TypeDeclaration typeDecl= parser.parse();
    DragomeJavaScriptGenerator dragomeJavaScriptGenerator= new DragomeJavaScriptGenerator(Project.singleton);
    dragomeJavaScriptGenerator.setOutputStream(new PrintStream(new FileOutputStream(new File("/tmp/webapp.js"))));
    dragomeJavaScriptGenerator.visit(typeDecl);
View Full Code Here

  public static void setClassNotReversible(MethodDeclaration methodDeclaration)
  {
    ObjectType declaringClass= methodDeclaration.getMethodBinding().getDeclaringClass();
    Log.getLogger().debug("Not reversible method: " + methodDeclaration.getMethodBinding().getName() + " in: " + declaringClass);
    ClassUnit classUnit= Project.getSingleton().getClassUnit(declaringClass.getClassName());
    classUnit.addNotReversibleMethod(extractMethodNameSignature(methodDeclaration.getMethodBinding()));
    //  classUnit.setReversible(false);
  }
View Full Code Here

TOP

Related Classes of com.dragome.compiler.units.ClassUnit

Copyright © 2018 www.massapicom. 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.