Java Code Examples for com.sun.codemodel.internal.JClassContainer#isPackage()

The following examples show how to use com.sun.codemodel.internal.JClassContainer#isPackage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BeanGenerator.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns all <i>used</i> JPackages.
 *
 * A JPackage is considered as "used" if a ClassItem or
 * a InterfaceItem resides in that package.
 *
 * This value is dynamically calculated every time because
 * one can freely remove ClassItem/InterfaceItem.
 *
 * @return
 *         Given the same input, the order of packages in the array
 *         is always the same regardless of the environment.
 */
public final JPackage[] getUsedPackages(Aspect aspect) {
    Set<JPackage> s = new TreeSet<JPackage>();

    for (CClassInfo bean : model.beans().values()) {
        JClassContainer cont = getContainer(bean.parent(), aspect);
        if (cont.isPackage()) {
            s.add((JPackage) cont);
        }
    }

    for (CElementInfo e : model.getElementMappings(null).values()) {
        // at the first glance you might think we should be iterating all elements,
        // not just global ones, but if you think about it, local ones live inside
        // another class, so those packages are already enumerated when we were
        // walking over CClassInfos.
        s.add(e._package());
    }

    return s.toArray(new JPackage[s.size()]);
}
 
Example 2
Source File: BeanGenerator.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns all <i>used</i> JPackages.
 *
 * A JPackage is considered as "used" if a ClassItem or
 * a InterfaceItem resides in that package.
 *
 * This value is dynamically calculated every time because
 * one can freely remove ClassItem/InterfaceItem.
 *
 * @return
 *         Given the same input, the order of packages in the array
 *         is always the same regardless of the environment.
 */
public final JPackage[] getUsedPackages(Aspect aspect) {
    Set<JPackage> s = new TreeSet<JPackage>();

    for (CClassInfo bean : model.beans().values()) {
        JClassContainer cont = getContainer(bean.parent(), aspect);
        if (cont.isPackage()) {
            s.add((JPackage) cont);
        }
    }

    for (CElementInfo e : model.getElementMappings(null).values()) {
        // at the first glance you might think we should be iterating all elements,
        // not just global ones, but if you think about it, local ones live inside
        // another class, so those packages are already enumerated when we were
        // walking over CClassInfos.
        s.add(e._package());
    }

    return s.toArray(new JPackage[s.size()]);
}
 
Example 3
Source File: BeanGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns all <i>used</i> JPackages.
 *
 * A JPackage is considered as "used" if a ClassItem or
 * a InterfaceItem resides in that package.
 *
 * This value is dynamically calculated every time because
 * one can freely remove ClassItem/InterfaceItem.
 *
 * @return
 *         Given the same input, the order of packages in the array
 *         is always the same regardless of the environment.
 */
public final JPackage[] getUsedPackages(Aspect aspect) {
    Set<JPackage> s = new TreeSet<JPackage>();

    for (CClassInfo bean : model.beans().values()) {
        JClassContainer cont = getContainer(bean.parent(), aspect);
        if (cont.isPackage()) {
            s.add((JPackage) cont);
        }
    }

    for (CElementInfo e : model.getElementMappings(null).values()) {
        // at the first glance you might think we should be iterating all elements,
        // not just global ones, but if you think about it, local ones live inside
        // another class, so those packages are already enumerated when we were
        // walking over CClassInfos.
        s.add(e._package());
    }

    return s.toArray(new JPackage[s.size()]);
}
 
Example 4
Source File: BeanGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns all <i>used</i> JPackages.
 *
 * A JPackage is considered as "used" if a ClassItem or
 * a InterfaceItem resides in that package.
 *
 * This value is dynamically calculated every time because
 * one can freely remove ClassItem/InterfaceItem.
 *
 * @return
 *         Given the same input, the order of packages in the array
 *         is always the same regardless of the environment.
 */
public final JPackage[] getUsedPackages(Aspect aspect) {
    Set<JPackage> s = new TreeSet<JPackage>();

    for (CClassInfo bean : model.beans().values()) {
        JClassContainer cont = getContainer(bean.parent(), aspect);
        if (cont.isPackage()) {
            s.add((JPackage) cont);
        }
    }

    for (CElementInfo e : model.getElementMappings(null).values()) {
        // at the first glance you might think we should be iterating all elements,
        // not just global ones, but if you think about it, local ones live inside
        // another class, so those packages are already enumerated when we were
        // walking over CClassInfos.
        s.add(e._package());
    }

    return s.toArray(new JPackage[s.size()]);
}
 
Example 5
Source File: BeanGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns all <i>used</i> JPackages.
 *
 * A JPackage is considered as "used" if a ClassItem or
 * a InterfaceItem resides in that package.
 *
 * This value is dynamically calculated every time because
 * one can freely remove ClassItem/InterfaceItem.
 *
 * @return
 *         Given the same input, the order of packages in the array
 *         is always the same regardless of the environment.
 */
public final JPackage[] getUsedPackages(Aspect aspect) {
    Set<JPackage> s = new TreeSet<JPackage>();

    for (CClassInfo bean : model.beans().values()) {
        JClassContainer cont = getContainer(bean.parent(), aspect);
        if (cont.isPackage()) {
            s.add((JPackage) cont);
        }
    }

    for (CElementInfo e : model.getElementMappings(null).values()) {
        // at the first glance you might think we should be iterating all elements,
        // not just global ones, but if you think about it, local ones live inside
        // another class, so those packages are already enumerated when we were
        // walking over CClassInfos.
        s.add(e._package());
    }

    return s.toArray(new JPackage[s.size()]);
}
 
Example 6
Source File: BeanGenerator.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns all <i>used</i> JPackages.
 *
 * A JPackage is considered as "used" if a ClassItem or
 * a InterfaceItem resides in that package.
 *
 * This value is dynamically calculated every time because
 * one can freely remove ClassItem/InterfaceItem.
 *
 * @return
 *         Given the same input, the order of packages in the array
 *         is always the same regardless of the environment.
 */
public final JPackage[] getUsedPackages(Aspect aspect) {
    Set<JPackage> s = new TreeSet<JPackage>();

    for (CClassInfo bean : model.beans().values()) {
        JClassContainer cont = getContainer(bean.parent(), aspect);
        if (cont.isPackage()) {
            s.add((JPackage) cont);
        }
    }

    for (CElementInfo e : model.getElementMappings(null).values()) {
        // at the first glance you might think we should be iterating all elements,
        // not just global ones, but if you think about it, local ones live inside
        // another class, so those packages are already enumerated when we were
        // walking over CClassInfos.
        s.add(e._package());
    }

    return s.toArray(new JPackage[s.size()]);
}
 
Example 7
Source File: BeanGenerator.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns all <i>used</i> JPackages.
 *
 * A JPackage is considered as "used" if a ClassItem or
 * a InterfaceItem resides in that package.
 *
 * This value is dynamically calculated every time because
 * one can freely remove ClassItem/InterfaceItem.
 *
 * @return
 *         Given the same input, the order of packages in the array
 *         is always the same regardless of the environment.
 */
public final JPackage[] getUsedPackages(Aspect aspect) {
    Set<JPackage> s = new TreeSet<JPackage>();

    for (CClassInfo bean : model.beans().values()) {
        JClassContainer cont = getContainer(bean.parent(), aspect);
        if (cont.isPackage()) {
            s.add((JPackage) cont);
        }
    }

    for (CElementInfo e : model.getElementMappings(null).values()) {
        // at the first glance you might think we should be iterating all elements,
        // not just global ones, but if you think about it, local ones live inside
        // another class, so those packages are already enumerated when we were
        // walking over CClassInfos.
        s.add(e._package());
    }

    return s.toArray(new JPackage[s.size()]);
}
 
Example 8
Source File: BeanGenerator.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns all <i>used</i> JPackages.
 *
 * A JPackage is considered as "used" if a ClassItem or
 * a InterfaceItem resides in that package.
 *
 * This value is dynamically calculated every time because
 * one can freely remove ClassItem/InterfaceItem.
 *
 * @return
 *         Given the same input, the order of packages in the array
 *         is always the same regardless of the environment.
 */
public final JPackage[] getUsedPackages(Aspect aspect) {
    Set<JPackage> s = new TreeSet<JPackage>();

    for (CClassInfo bean : model.beans().values()) {
        JClassContainer cont = getContainer(bean.parent(), aspect);
        if (cont.isPackage()) {
            s.add((JPackage) cont);
        }
    }

    for (CElementInfo e : model.getElementMappings(null).values()) {
        // at the first glance you might think we should be iterating all elements,
        // not just global ones, but if you think about it, local ones live inside
        // another class, so those packages are already enumerated when we were
        // walking over CClassInfos.
        s.add(e._package());
    }

    return s.toArray(new JPackage[s.size()]);
}