Examples of TypeDeclaration


Examples of org.eclipse.jdt.core.dom.TypeDeclaration

    private AbstractTypeDeclaration createClass(String cname, boolean isenum) {
        AbstractTypeDeclaration abstype;
        if (isenum) {
            abstype = m_ast.newEnumDeclaration();
        } else {
            TypeDeclaration type = m_ast.newTypeDeclaration();
            type.setInterface(false);
            abstype = type;
        }
        abstype.modifiers().add(m_ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
        abstype.setName(m_ast.newSimpleName(cname));
        return abstype;
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration

            // parse the resulting text
            m_parser.setSource(buff.toString().toCharArray());
            CompilationUnit unit = (CompilationUnit)m_parser.createAST(null);
           
            // add all methods from output tree to class under construction
            TypeDeclaration typedecl = (TypeDeclaration)unit.types().get(0);
            for (Iterator iter = typedecl.bodyDeclarations().iterator(); iter.hasNext();) {
                ASTNode node = (ASTNode)iter.next();
                if (node instanceof MethodDeclaration) {
                    holder.addMethod((MethodDeclaration)node);
                }
            }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration

           
            // parse class text to get field declaration
            String text = "class gorph { private static final long serialVersionUID = " + m_serialVersion + "; }";
            m_parser.setSource(text.toCharArray());
            CompilationUnit unit = (CompilationUnit)m_parser.createAST(null);
            TypeDeclaration type = (TypeDeclaration)unit.types().get(0);
            FieldDeclaration field = (FieldDeclaration)type.bodyDeclarations().get(0);
            holder.addField(field);
           
        }
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration

  public JClass getDeclaredClass() {
    List types = _unit.types();
    ListIterator typeIter = types.listIterator(0);
    if (typeIter.hasNext()) {
      TypeDeclaration object = (TypeDeclaration) typeIter.next();
      _class = new JClass();
      setClassInformation(_class, object);
      return _class;
    }
    return null;
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.ast.TypeDeclaration

  int index = 1;
  do {
    needRecheck = false;
    FieldBinding existingField;
    if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) {
      TypeDeclaration typeDecl = this.scope.referenceContext;
      for (int i = 0, max = typeDecl.fields.length; i < max; i++) {
        FieldDeclaration fieldDecl = typeDecl.fields[i];
        if (fieldDecl.binding == existingField) {
          synthField.name = CharOperation.concat(
            TypeConstants.SYNTHETIC_OUTER_LOCAL_PREFIX,
View Full Code Here

Examples of org.eclipse.xtend.lib.macro.declaration.TypeDeclaration

      }
      return _xblockexpression;
    }
   
    public Iterable<? extends MemberDeclaration> otherDelegates(final MemberDeclaration delegate) {
      TypeDeclaration _declaringType = delegate.getDeclaringType();
      Iterable<? extends MemberDeclaration> _delegates = this.getDelegates(_declaringType);
      final Function1<MemberDeclaration, Boolean> _function = new Function1<MemberDeclaration, Boolean>() {
        public Boolean apply(final MemberDeclaration it) {
          return Boolean.valueOf((!Objects.equal(it, delegate)));
        }
View Full Code Here

Examples of org.enhydra.shark.xpdl.elements.TypeDeclaration

    }

    public TypeDeclaration createXPDLObject(TypeDeclarations tds,
            String type,
            boolean addToCollection) {
        TypeDeclaration td = (TypeDeclaration) tds.generateNewElement();
        adjustType(td, type);

        JaWETypes jts = JaWEManager.getInstance().getJaWEController().getJaWETypes();
        boolean hasTemplate = jts.hasTemplateId(type);
        if (hasTemplate) {
            jts.fillFromTemplate(td, type);
        }
        String id = td.getId();
        if (!hasTemplate || id.equals("") || tds.getTypeDeclaration(id) != null) {
            if (id.equals("")) {
                id = JaWEManager.getInstance().getIdFactory().generateUniqueId(tds);
            } else {
                id = JaWEManager.getInstance().getIdFactory().generateSimilarOrIdenticalUniqueId(tds, new HashSet(), id);
            }
            int i = 0;
            while (tds.getTypeDeclaration(id) != null) {
                id = id + String.valueOf(++i);
            }
            td.setId(id);
        }

        adjustXPDLObject(td, type);

        if (addToCollection) {
View Full Code Here

Examples of wyvern.tools.typedAST.core.declarations.TypeDeclaration

  public TypeVarDecl(String name, DeclSequence body, TypedAST metadata, FileLocation fileLocation) {
    this.metadata = new Reference<Optional<TypedAST>>(Optional.ofNullable(metadata));
    this.name = name;
    this.metadataObj = new Reference<>();
    this.body = new TypeDeclaration(name, body, this.metadataObj, fileLocation);
    this.fileLocation = fileLocation;
  }
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.