Java Code Examples for sun.tools.java.Identifier#lookup()

The following examples show how to use sun.tools.java.Identifier#lookup() . 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: Names.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * If necessary, convert a class name to its mangled form, i.e. the
 * non-inner class name used in the binary representation of
 * inner classes.  This is necessary to be able to name inner
 * classes in the generated source code in places where the language
 * does not permit it, such as when synthetically defining an inner
 * class outside of its outer class, and for generating file names
 * corresponding to inner classes.
 *
 * Currently this mangling involves modifying the internal names of
 * inner classes by converting occurrences of ". " into "$".
 *
 * This code is taken from the "mangleInnerType" method of
 * the "sun.tools.java.Type" class; this method cannot be accessed
 * itself because it is package protected.
 */
static final public Identifier mangleClass(Identifier className) {
    if (!className.isInner())
        return className;

    /*
     * Get '.' qualified inner class name (with outer class
     * qualification and no package qualification) and replace
     * each '.' with '$'.
     */
    Identifier mangled = Identifier.lookup(
                                           className.getFlatName().toString()
                                           .replace('.', sun.tools.java.Constants.SIGC_INNERCLASS));
    if (mangled.isInner())
        throw new Error("failed to mangle inner class name");

    // prepend package qualifier back for returned identifier
    return Identifier.lookup(className.getQualifier(), mangled);
}
 
Example 2
Source File: Names.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * If necessary, convert a class name to its mangled form, i.e. the
 * non-inner class name used in the binary representation of
 * inner classes.  This is necessary to be able to name inner
 * classes in the generated source code in places where the language
 * does not permit it, such as when synthetically defining an inner
 * class outside of its outer class, and for generating file names
 * corresponding to inner classes.
 *
 * Currently this mangling involves modifying the internal names of
 * inner classes by converting occurrences of ". " into "$".
 *
 * This code is taken from the "mangleInnerType" method of
 * the "sun.tools.java.Type" class; this method cannot be accessed
 * itself because it is package protected.
 */
static final public Identifier mangleClass(Identifier className) {
    if (!className.isInner())
        return className;

    /*
     * Get '.' qualified inner class name (with outer class
     * qualification and no package qualification) and replace
     * each '.' with '$'.
     */
    Identifier mangled = Identifier.lookup(
                                           className.getFlatName().toString()
                                           .replace('.', sun.tools.java.Constants.SIGC_INNERCLASS));
    if (mangled.isInner())
        throw new Error("failed to mangle inner class name");

    // prepend package qualifier back for returned identifier
    return Identifier.lookup(className.getQualifier(), mangled);
}
 
Example 3
Source File: Names.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * If necessary, convert a class name to its mangled form, i.e. the
 * non-inner class name used in the binary representation of
 * inner classes.  This is necessary to be able to name inner
 * classes in the generated source code in places where the language
 * does not permit it, such as when synthetically defining an inner
 * class outside of its outer class, and for generating file names
 * corresponding to inner classes.
 *
 * Currently this mangling involves modifying the internal names of
 * inner classes by converting occurrences of ". " into "$".
 *
 * This code is taken from the "mangleInnerType" method of
 * the "sun.tools.java.Type" class; this method cannot be accessed
 * itself because it is package protected.
 */
static final public Identifier mangleClass(Identifier className) {
    if (!className.isInner())
        return className;

    /*
     * Get '.' qualified inner class name (with outer class
     * qualification and no package qualification) and replace
     * each '.' with '$'.
     */
    Identifier mangled = Identifier.lookup(
                                           className.getFlatName().toString()
                                           .replace('.', sun.tools.java.Constants.SIGC_INNERCLASS));
    if (mangled.isInner())
        throw new Error("failed to mangle inner class name");

    // prepend package qualifier back for returned identifier
    return Identifier.lookup(className.getQualifier(), mangled);
}
 
Example 4
Source File: Names.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * If necessary, convert a class name to its mangled form, i.e. the
 * non-inner class name used in the binary representation of
 * inner classes.  This is necessary to be able to name inner
 * classes in the generated source code in places where the language
 * does not permit it, such as when synthetically defining an inner
 * class outside of its outer class, and for generating file names
 * corresponding to inner classes.
 *
 * Currently this mangling involves modifying the internal names of
 * inner classes by converting occurrences of ". " into "$".
 *
 * This code is taken from the "mangleInnerType" method of
 * the "sun.tools.java.Type" class; this method cannot be accessed
 * itself because it is package protected.
 */
static final public Identifier mangleClass(Identifier className) {
    if (!className.isInner())
        return className;

    /*
     * Get '.' qualified inner class name (with outer class
     * qualification and no package qualification) and replace
     * each '.' with '$'.
     */
    Identifier mangled = Identifier.lookup(
                                           className.getFlatName().toString()
                                           .replace('.', sun.tools.java.Constants.SIGC_INNERCLASS));
    if (mangled.isInner())
        throw new Error("failed to mangle inner class name");

    // prepend package qualifier back for returned identifier
    return Identifier.lookup(className.getQualifier(), mangled);
}
 
Example 5
Source File: Names.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * If necessary, convert a class name to its mangled form, i.e. the
 * non-inner class name used in the binary representation of
 * inner classes.  This is necessary to be able to name inner
 * classes in the generated source code in places where the language
 * does not permit it, such as when synthetically defining an inner
 * class outside of its outer class, and for generating file names
 * corresponding to inner classes.
 *
 * Currently this mangling involves modifying the internal names of
 * inner classes by converting occurrences of ". " into "$".
 *
 * This code is taken from the "mangleInnerType" method of
 * the "sun.tools.java.Type" class; this method cannot be accessed
 * itself because it is package protected.
 */
static final public Identifier mangleClass(Identifier className) {
    if (!className.isInner())
        return className;

    /*
     * Get '.' qualified inner class name (with outer class
     * qualification and no package qualification) and replace
     * each '.' with '$'.
     */
    Identifier mangled = Identifier.lookup(
                                           className.getFlatName().toString()
                                           .replace('.', sun.tools.java.Constants.SIGC_INNERCLASS));
    if (mangled.isInner())
        throw new Error("failed to mangle inner class name");

    // prepend package qualifier back for returned identifier
    return Identifier.lookup(className.getQualifier(), mangled);
}
 
Example 6
Source File: Names.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * If necessary, convert a class name to its mangled form, i.e. the
 * non-inner class name used in the binary representation of
 * inner classes.  This is necessary to be able to name inner
 * classes in the generated source code in places where the language
 * does not permit it, such as when synthetically defining an inner
 * class outside of its outer class, and for generating file names
 * corresponding to inner classes.
 *
 * Currently this mangling involves modifying the internal names of
 * inner classes by converting occurrences of ". " into "$".
 *
 * This code is taken from the "mangleInnerType" method of
 * the "sun.tools.java.Type" class; this method cannot be accessed
 * itself because it is package protected.
 */
static final public Identifier mangleClass(Identifier className) {
    if (!className.isInner())
        return className;

    /*
     * Get '.' qualified inner class name (with outer class
     * qualification and no package qualification) and replace
     * each '.' with '$'.
     */
    Identifier mangled = Identifier.lookup(
                                           className.getFlatName().toString()
                                           .replace('.', sun.tools.java.Constants.SIGC_INNERCLASS));
    if (mangled.isInner())
        throw new Error("failed to mangle inner class name");

    // prepend package qualifier back for returned identifier
    return Identifier.lookup(className.getQualifier(), mangled);
}
 
Example 7
Source File: Names.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * If necessary, convert a class name to its mangled form, i.e. the
 * non-inner class name used in the binary representation of
 * inner classes.  This is necessary to be able to name inner
 * classes in the generated source code in places where the language
 * does not permit it, such as when synthetically defining an inner
 * class outside of its outer class, and for generating file names
 * corresponding to inner classes.
 *
 * Currently this mangling involves modifying the internal names of
 * inner classes by converting occurrences of ". " into "$".
 *
 * This code is taken from the "mangleInnerType" method of
 * the "sun.tools.java.Type" class; this method cannot be accessed
 * itself because it is package protected.
 */
static final public Identifier mangleClass(Identifier className) {
    if (!className.isInner())
        return className;

    /*
     * Get '.' qualified inner class name (with outer class
     * qualification and no package qualification) and replace
     * each '.' with '$'.
     */
    Identifier mangled = Identifier.lookup(
                                           className.getFlatName().toString()
                                           .replace('.', sun.tools.java.Constants.SIGC_INNERCLASS));
    if (mangled.isInner())
        throw new Error("failed to mangle inner class name");

    // prepend package qualifier back for returned identifier
    return Identifier.lookup(className.getQualifier(), mangled);
}
 
Example 8
Source File: Names.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return stub class name for impl class name.
 */
static final public Identifier stubFor(Identifier name) {
    return Identifier.lookup(name + "_Stub");
}
 
Example 9
Source File: Names.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return skeleton class name for impl class name.
 */
static final public Identifier skeletonFor(Identifier name) {
    return Identifier.lookup(name + "_Skel");
}
 
Example 10
Source File: Names.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return stub class name for impl class name.
 */
static final public Identifier stubFor(Identifier name) {
    return Identifier.lookup(name + "_Stub");
}
 
Example 11
Source File: Names.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return stub class name for impl class name.
 */
static final public Identifier stubFor(Identifier name) {
    return Identifier.lookup(name + "_Stub");
}
 
Example 12
Source File: Names.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return stub class name for impl class name.
 */
static final public Identifier stubFor(Identifier name) {
    return Identifier.lookup(name + "_Stub");
}
 
Example 13
Source File: Names.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return stub class name for impl class name.
 */
static final public Identifier stubFor(Identifier name) {
    return Identifier.lookup(name + "_Stub");
}
 
Example 14
Source File: Names.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return skeleton class name for impl class name.
 */
static final public Identifier skeletonFor(Identifier name) {
    return Identifier.lookup(name + "_Skel");
}
 
Example 15
Source File: Names.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return skeleton class name for impl class name.
 */
static final public Identifier skeletonFor(Identifier name) {
    return Identifier.lookup(name + "_Skel");
}
 
Example 16
Source File: Names.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return stub class name for impl class name.
 */
static final public Identifier stubFor(Identifier name) {
    return Identifier.lookup(name + "_Stub");
}
 
Example 17
Source File: Names.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return skeleton class name for impl class name.
 */
static final public Identifier skeletonFor(Identifier name) {
    return Identifier.lookup(name + "_Skel");
}
 
Example 18
Source File: Names.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return skeleton class name for impl class name.
 */
static final public Identifier skeletonFor(Identifier name) {
    return Identifier.lookup(name + "_Skel");
}
 
Example 19
Source File: Names.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return stub class name for impl class name.
 */
static final public Identifier stubFor(Identifier name) {
    return Identifier.lookup(name + "_Stub");
}
 
Example 20
Source File: Names.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return skeleton class name for impl class name.
 */
static final public Identifier skeletonFor(Identifier name) {
    return Identifier.lookup(name + "_Skel");
}