Name.append
Code IndexAdd Codota to your IDE (free)

Best code snippets using com.sun.tools.javac.util.Name.append(Showing top 14 results out of 315)

  • Common ways to obtain Name
private void myMethod () {
Name n =
  • JCTree tree;TreeInfo.name(tree)
  • Tokens.Token tokensToken;tokensToken.name()
  • Names names;names.fromString(str)
  • Smart code suggestions by Codota
}
origin: org.netbeans.api/org-netbeans-modules-java-source

public Name fullName(JCTree tree) {
switch (tree.getTag()) {
case IDENT:
  return ((JCIdent) tree).name;
case SELECT:
    JCFieldAccess sel = (JCFieldAccess)tree;
  Name sname = fullName(sel.selected);
  return sname != null && sname.getByteLength() > 0 ? sname.append('.', sel.name) : sel.name;
default:
  return null;
}
}
origin: org.jvnet.sorcerer/sorcerer-javac

/** Unbox an object to a primitive value. */
JCExpression unbox(JCExpression tree, Type primitive) {
Type unboxedType = types.unboxedType(tree.type);
// note: the "primitive" parameter is not used.  There muse be
// a conversion from unboxedType to primitive.
make_at(tree.pos());
Symbol valueSym = lookupMethod(tree.pos(),
          unboxedType.tsym.name.append(names.Value), // x.intValue()
          tree.type,
          List.<Type>nil());
return make.App(make.Select(tree, valueSym));
}
origin: org.netbeans.modules/org-netbeans-lib-nbjavac

public void newAnonScope(final Name name, final int startNumber) {
  AnonScope parent = anonScopes.isEmpty() ? null : anonScopes.peek();
  Name fqn = parent != null && parent.parentDecl != names.empty ? parent.parentDecl.append('.', name) : name;
  AnonScope scope = anonScopeMap.get(fqn);
  if (scope == null) {
    scope = new AnonScope(name, startNumber);
    anonScopeMap.put(fqn, scope);
  }
  anonScopes.push(scope);
}
origin: org.jvnet.sorcerer/sorcerer-javac

/** form a fully qualified name from a name and an owner, after
 *  converting to flat representation
 */
static public Name formFlatName(Name name, Symbol owner) {
  if (owner == null ||
    (owner.kind & (VAR | MTH)) != 0
    || (owner.kind == TYP && owner.type.tag == TYPEVAR)
    ) return name;
  char sep = owner.kind == TYP ? '$' : '.';
  Name prefix = owner.flatName();
  if (prefix == null || prefix == prefix.table.empty)
    return name;
  else return prefix.append(sep, name);
}
origin: com.google.errorprone/javac

/** If this tree is a qualified identifier, its return fully qualified name,
 *  otherwise return null.
 */
public static Name fullName(JCTree tree) {
  tree = skipParens(tree);
  switch (tree.getTag()) {
  case IDENT:
    return ((JCIdent) tree).name;
  case SELECT:
    Name sname = fullName(((JCFieldAccess) tree).selected);
    return sname == null ? null : sname.append('.', name(tree));
  default:
    return null;
  }
}
origin: com.google.errorprone/javac

/** Create a fresh synthetic name within a given scope - the unique name is
 *  obtained by appending '$' chars at the end of the name until no match
 *  is found.
 *
 * @param name base name
 * @param s scope in which the name has to be unique
 * @return fresh synthetic name
 */
private Name makeSyntheticName(Name name, Scope s) {
  do {
    name = name.append(
        target.syntheticNameChar(),
        names.empty);
  } while (lookupSynthetic(name, s) != null);
  return name;
}
origin: com.google.errorprone/javac

Symbol lookupPackage(Env<AttrContext> env, Name name) {
  PackageSymbol pack = syms.lookupPackage(env.toplevel.modle, name);
  if (allowModules && isImportOnDemand(env, name)) {
    pack.complete();
    if (!pack.exists()) {
      Name nameAndDot = name.append('.', names.empty);
      boolean prefixOfKnown =
          env.toplevel.modle.visiblePackages.values()
                           .stream()
                           .anyMatch(p -> p.fullname.startsWith(nameAndDot));
      return lookupInvisibleSymbol(env, name, syms::getPackagesForName, syms::enterPackage, sym -> {
        sym.complete();
        return sym.exists();
      }, prefixOfKnown, pack);
    }
  }
  return pack;
}
origin: com.google.errorprone/javac

/** form a fully qualified name from a name and an owner
 */
static public Name formFullName(Name name, Symbol owner) {
  if (owner == null) return name;
  if ((owner.kind != ERR) &&
    (owner.kind.matches(KindSelector.VAL_MTH) ||
     (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
     )) return name;
  Name prefix = owner.getQualifiedName();
  if (prefix == null || prefix == prefix.table.names.empty)
    return name;
  else return prefix.append('.', name);
}
origin: com.google.errorprone/javac

@Override
public void complete(Symbol sym) throws CompletionFailure {
  try {
    completer.complete(sym);
  } catch (CompletionFailure e) {
    sym.flags_field |= PUBLIC;
    ((ClassType) sym.type).supertype_field = objectType;
    MethodSymbol boxMethod =
      new MethodSymbol(PUBLIC | STATIC, names.valueOf,
               new MethodType(List.of(type), sym.type,
          List.nil(), methodClass),
        sym);
    sym.members().enter(boxMethod);
    MethodSymbol unboxMethod =
      new MethodSymbol(PUBLIC,
        type.tsym.name.append(names.Value), // x.intValue()
        new MethodType(List.nil(), type,
          List.nil(), methodClass),
        sym);
    sym.members().enter(unboxMethod);
  }
}
origin: com.google.errorprone/javac

/** Unbox an object to a primitive value. */
JCExpression unbox(JCExpression tree, Type primitive) {
  Type unboxedType = types.unboxedType(tree.type);
  if (unboxedType.hasTag(NONE)) {
    unboxedType = primitive;
    if (!unboxedType.isPrimitive())
      throw new AssertionError(unboxedType);
    make_at(tree.pos());
    tree = make.TypeCast(types.boxedClass(unboxedType).type, tree);
  } else {
    // There must be a conversion from unboxedType to primitive.
    if (!types.isSubtype(unboxedType, primitive))
      throw new AssertionError(tree);
  }
  make_at(tree.pos());
  Symbol valueSym = lookupMethod(tree.pos(),
                  unboxedType.tsym.name.append(names.Value), // x.intValue()
                  tree.type,
                  List.nil());
  return make.App(make.Select(tree, valueSym));
}
origin: org.jvnet.sorcerer/sorcerer-javac

/** form a fully qualified name from a name and an owner
 */
static public Name formFullName(Name name, Symbol owner) {
  if (owner == null) return name;
  if (((owner.kind != ERR)) &&
    ((owner.kind & (VAR | MTH)) != 0
     || (owner.kind == TYP && owner.type.tag == TYPEVAR)
     )) return name;
  Name prefix = owner.getQualifiedName();
  if (prefix == null || prefix == prefix.table.empty)
    return name;
  else return prefix.append('.', name);
}
origin: org.jvnet.sorcerer/sorcerer-javac

/** If this tree is a qualified identifier, its return fully qualified name,
 *  otherwise return null.
 */
public static Name fullName(JCTree tree) {
tree = skipParens(tree);
switch (tree.tag) {
case JCTree.IDENT:
  return ((JCIdent) tree).name;
case JCTree.SELECT:
  Name sname = fullName(((JCFieldAccess) tree).selected);
  return sname == null ? null : sname.append('.', name(tree));
default:
  return null;
}
}
origin: com.google.errorprone/javac

/** form a fully qualified name from a name and an owner, after
 *  converting to flat representation
 */
static public Name formFlatName(Name name, Symbol owner) {
  if (owner == null || owner.kind.matches(KindSelector.VAL_MTH) ||
    (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
    ) return name;
  char sep = owner.kind == TYP ? '$' : '.';
  Name prefix = owner.flatName();
  if (prefix == null || prefix == prefix.table.names.empty)
    return name;
  else return prefix.append(sep, name);
}
origin: org.netbeans.api/org-netbeans-modules-java-source-base

public Name fullName(JCTree tree) {
switch (tree.getTag()) {
case IDENT:
  return ((JCIdent) tree).name;
case SELECT:
    JCFieldAccess sel = (JCFieldAccess)tree;
  Name sname = fullName(sel.selected);
  return sname != null && sname.getByteLength() > 0 ? sname.append('.', sel.name) : sel.name;
default:
  return null;
}
}
com.sun.tools.javac.utilNameappend

Javadoc

Return the concatenation of this name, the given ASCII character, and name `n'.

Popular methods of Name

  • toString
    Return the string representation of this name.
  • contentEquals
  • isEmpty
    Return true if this is the empty name.
  • toUtf
    Return the Utf8 representation of this name.
  • getByteArray
    Get the underlying byte array for this name. The contents of the array must not be modified.
  • getByteLength
    Get the length (in bytes) of this name.
  • getByteOffset
    Get the start offset of this name within its byte array.
  • length
  • startsWith
    Does this name start with prefix?
  • compareTo
    An arbitrary but consistent complete order among all Names.
  • getBytes
    Copy all bytes of this name to buffer cs, starting at start.
  • lastIndexOf
    Returns last occurrence of byte b in this name, -1 if not found.
  • getBytes,
  • lastIndexOf,
  • subName,
  • <init>,
  • byteAt,
  • equals,
  • fromChars,
  • fromString,
  • fromUtf

Popular classes and methods

  • setContentView (Activity)
  • setRequestProperty (URLConnection)
    Sets the value of the specified request header field. The value will only be used by the current URL
  • onCreateOptionsMenu (Activity)
  • BufferedImage (java.awt.image)
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)