Package com.sun.tools.javac.code.Symbol

Examples of com.sun.tools.javac.code.Symbol.ClassSymbol


            // instance initializer blocks, or instance variable
            // initializer expressions of an enum constant e to refer
            // to itself or to an enum constant of the same type that
            // is declared to the right of e."
            if (isStaticEnumField(v)) {
                ClassSymbol enclClass = env.info.scope.owner.enclClass();

                if (enclClass == null || enclClass.owner == null)
                    return;

                // See if the enclosing class is the enum (or a
View Full Code Here


            JCClassDecl cd = make.at(tree.pos).ClassDef(
                make.Modifiers(PUBLIC | ABSTRACT),
                tree.name, List.<JCTypeParameter>nil(),
                extending, implementing, List.<JCTree>nil());

            ClassSymbol c = (ClassSymbol)a.getUpperBound().tsym;
            Assert.check((c.flags() & COMPOUND) != 0);
            cd.sym = c;
            c.sourcefile = env.toplevel.sourcefile;

            // ... and attribute the bound class
            c.flags_field |= UNATTRIBUTED;
View Full Code Here

    public DeclaredType getContainingType() {
        if (type.getEnclosingType().tag == TypeTags.CLASS) {
            // This is the type of an inner class.
            return (DeclaredType) env.typeMaker.getType(type.getEnclosingType());
        }
        ClassSymbol enclosing = type.tsym.owner.enclClass();
        if (enclosing != null) {
            // Nested but not inner.  Return the raw type of the enclosing
            // class or interface.
            // See java.lang.reflect.ParameterizedType.getOwnerType().
            return (DeclaredType) env.typeMaker.getType(
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public TypeDeclaration getDeclaringType() {
        ClassSymbol c = getDeclaringClassSymbol();
        return (c == null)
            ? null
            : env.declMaker.getTypeDeclaration(c);
    }
View Full Code Here

        @Override
        public void visitClassDef(JCClassDecl that) {
            initTypeIfNeeded(that);
            if (that.sym == null) {
                that.sym = new ClassSymbol(0, that.name, that.type, syms.noSymbol);
            }
            super.visitClassDef(that);
        }
View Full Code Here

     * Get the name.
     *
     * @return the name of the member qualified by class (but not package)
     */
    public String name() {
        ClassSymbol c = sym.enclClass();
        String n = c.name.toString();
        for (c = c.owner.enclClass(); c != null; c = c.owner.enclClass()) {
            n = c.name.toString() + "." + n;
        }
        return n;
View Full Code Here

            return allClassesFiltered;
        }
        ListBuffer<ClassDocImpl> classes = new ListBuffer<ClassDocImpl>();
        for (Scope.Entry e = sym.members().elems; e != null; e = e.sibling) {
            if (e.sym != null) {
                ClassSymbol s = (ClassSymbol)e.sym;
                ClassDocImpl c = env.getClassDoc(s);
                if (c != null && !c.isSynthetic())
                    c.addAllClasses(classes, filtered);
            }
        }
View Full Code Here

    public com.sun.javadoc.Type containingType() {
        if (type.getEnclosingType().tag == CLASS) {
            // This is the type of an inner class.
            return TypeMaker.getType(env, type.getEnclosingType());
        }
        ClassSymbol enclosing = type.tsym.owner.enclClass();
        if (enclosing != null) {
            // Nested but not inner.  Return the ClassDoc of the enclosing
            // class or interface.
            // See java.lang.reflect.ParameterizedType.getOwnerType().
            return env.getClassDoc(enclosing);
View Full Code Here

                    + ", type: " + e.asType()
                    + ", encl: " + e.getEnclosingElement());

            // The following checks help establish why NPE might occur when trying to scan children
            if (e instanceof ClassSymbol) {
                ClassSymbol csym = (ClassSymbol) e;
                if (csym.members_field == null)
                    error("members_field is null");
                if (csym.type == null)
                    System.err.println("type is null");
            }
View Full Code Here

                 */
                for(Symbol m : ceylonPkg.members().getElements()){
                    // skip things that are not classes (perhaps package-info?)
                    if(!(m instanceof ClassSymbol))
                        continue;
                    ClassSymbol enclosingClass = getEnclosing((ClassSymbol) m);

                    if(!Util.isLoadedFromSource(enclosingClass)){
                        m.complete();
                        // avoid anonymous and local classes
                        if(isAnonymousOrLocal((ClassSymbol) m))
View Full Code Here

TOP

Related Classes of com.sun.tools.javac.code.Symbol.ClassSymbol

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.