Tabnine Logo
ClassWriter.newClass
Code IndexAdd Tabnine to your IDE (free)

How to use
newClass
method
in
jersey.repackaged.org.objectweb.asm.ClassWriter

Best Java code snippets using jersey.repackaged.org.objectweb.asm.ClassWriter.newClass (Showing top 20 results out of 315)

origin: com.sun.jersey/jersey-server

@Override
public final void visit(final int version, final int access,
    final String name, final String signature, final String superName,
    final String[] interfaces) {
  this.version = version;
  this.access = access;
  this.name = newClass(name);
  thisName = name;
  if (ClassReader.SIGNATURES && signature != null) {
    this.signature = newUTF8(signature);
  }
  this.superName = superName == null ? 0 : newClass(superName);
  if (interfaces != null && interfaces.length > 0) {
    interfaceCount = interfaces.length;
    this.interfaces = new int[interfaceCount];
    for (int i = 0; i < interfaceCount; ++i) {
      this.interfaces[i] = newClass(interfaces[i]);
    }
  }
}
origin: com.sun.jersey/jersey-server

@Override
public final void visitInnerClass(final String name,
    final String outerName, final String innerName, final int access) {
  if (innerClasses == null) {
    innerClasses = new ByteVector();
  }
  // Sec. 4.7.6 of the JVMS states "Every CONSTANT_Class_info entry in the
  // constant_pool table which represents a class or interface C that is
  // not a package member must have exactly one corresponding entry in the
  // classes array". To avoid duplicates we keep track in the intVal field
  // of the Item of each CONSTANT_Class_info entry C whether an inner
  // class entry has already been added for C (this field is unused for
  // class entries, and changing its value does not change the hashcode
  // and equality tests). If so we store the index of this inner class
  // entry (plus one) in intVal. This hack allows duplicate detection in
  // O(1) time.
  Item nameItem = newClassItem(name);
  if (nameItem.intVal == 0) {
    ++innerClassesCount;
    innerClasses.putShort(nameItem.index);
    innerClasses.putShort(outerName == null ? 0 : newClass(outerName));
    innerClasses.putShort(innerName == null ? 0 : newUTF8(innerName));
    innerClasses.putShort(access);
    nameItem.intVal = innerClassesCount;
  } else {
    // Compare the inner classes entry nameItem.intVal - 1 with the
    // arguments of this method and throw an exception if there is a
    // difference?
  }
}
origin: com.sun.jersey/jersey-server

@Override
public final void visitOuterClass(final String owner, final String name,
    final String desc) {
  enclosingMethodOwner = newClass(owner);
  if (name != null && desc != null) {
    enclosingMethod = newNameType(name, desc);
  }
}
origin: org.glassfish.jersey.core/jersey-server

@Override
public final void visitInnerClass(final String name,
                 final String outerName, final String innerName, final int access) {
  if (innerClasses == null) {
    innerClasses = new ByteVector();
  }
  // Sec. 4.7.6 of the JVMS states "Every CONSTANT_Class_info entry in the
  // constant_pool table which represents a class or interface C that is
  // not a package member must have exactly one corresponding entry in the
  // classes array". To avoid duplicates we keep track in the intVal field
  // of the Item of each CONSTANT_Class_info entry C whether an inner
  // class entry has already been added for C (this field is unused for
  // class entries, and changing its value does not change the hashcode
  // and equality tests). If so we store the index of this inner class
  // entry (plus one) in intVal. This hack allows duplicate detection in
  // O(1) time.
  Item nameItem = newClassItem(name);
  if (nameItem.intVal == 0) {
    ++innerClassesCount;
    innerClasses.putShort(nameItem.index);
    innerClasses.putShort(outerName == null ? 0 : newClass(outerName));
    innerClasses.putShort(innerName == null ? 0 : newUTF8(innerName));
    innerClasses.putShort(access);
    nameItem.intVal = innerClassesCount;
  } else {
    // Compare the inner classes entry nameItem.intVal - 1 with the
    // arguments of this method and throw an exception if there is a
    // difference?
  }
}
origin: com.sun.jersey/jersey-server

@Override
public void visitTryCatchBlock(final Label start, final Label end,
    final Label handler, final String type) {
  ++handlerCount;
  Handler h = new Handler();
  h.start = start;
  h.end = end;
  h.handler = handler;
  h.desc = type;
  h.type = type != null ? cw.newClass(type) : 0;
  if (lastHandler == null) {
    firstHandler = h;
  } else {
    lastHandler.next = h;
  }
  lastHandler = h;
}
origin: com.sun.jersey/jersey-server

case Frame.OBJECT:
  stackMap.putByte(7).putShort(
      cw.newClass(cw.typeTable[v].strVal1));
  break;
case Frame.UNINITIALIZED:
stackMap.putByte(7).putShort(cw.newClass(sb.toString()));
origin: com.sun.jersey/jersey-server

private void writeFrameType(final Object type) {
  if (type instanceof String) {
    stackMap.putByte(7).putShort(cw.newClass((String) type));
  } else if (type instanceof Integer) {
    stackMap.putByte(((Integer) type).intValue());
  } else {
    stackMap.putByte(8).putShort(((Label) type).position);
  }
}
origin: com.sun.jersey/jersey-server

this.exceptions = new int[exceptionCount];
for (int i = 0; i < exceptionCount; ++i) {
  this.exceptions[i] = cw.newClass(exceptions[i]);
origin: com.sun.jersey/jersey-server

/**
 * Adds a field reference to the constant pool of the class being build.
 * Does nothing if the constant pool already contains a similar item.
 *
 * @param owner
 *            the internal name of the field's owner class.
 * @param name
 *            the field's name.
 * @param desc
 *            the field's descriptor.
 * @return a new or already existing field reference item.
 */
Item newFieldItem(final String owner, final String name, final String desc) {
  key3.set(FIELD, owner, name, desc);
  Item result = get(key3);
  if (result == null) {
    put122(FIELD, newClass(owner), newNameType(name, desc));
    result = new Item(index++, key3);
    put(result);
  }
  return result;
}
origin: com.sun.jersey/jersey-server

/**
 * Adds a method reference to the constant pool of the class being build.
 * Does nothing if the constant pool already contains a similar item.
 *
 * @param owner
 *            the internal name of the method's owner class.
 * @param name
 *            the method's name.
 * @param desc
 *            the method's descriptor.
 * @param itf
 *            <tt>true</tt> if <tt>owner</tt> is an interface.
 * @return a new or already existing method reference item.
 */
Item newMethodItem(final String owner, final String name,
    final String desc, final boolean itf) {
  int type = itf ? IMETH : METH;
  key3.set(type, owner, name, desc);
  Item result = get(key3);
  if (result == null) {
    put122(type, newClass(owner), newNameType(name, desc));
    result = new Item(index++, key3);
    put(result);
  }
  return result;
}
origin: org.glassfish.jersey.core/jersey-server

@Override
public final void visit(final int version, final int access,
            final String name, final String signature, final String superName,
            final String[] interfaces) {
  this.version = version;
  this.access = access;
  this.name = newClass(name);
  thisName = name;
  if (ClassReader.SIGNATURES && signature != null) {
    this.signature = newUTF8(signature);
  }
  this.superName = superName == null ? 0 : newClass(superName);
  if (interfaces != null && interfaces.length > 0) {
    interfaceCount = interfaces.length;
    this.interfaces = new int[interfaceCount];
    for (int i = 0; i < interfaceCount; ++i) {
      this.interfaces[i] = newClass(interfaces[i]);
    }
  }
}
origin: org.glassfish.jersey.core/jersey-server

@Override
public final void visitOuterClass(final String owner, final String name,
                 final String desc) {
  enclosingMethodOwner = newClass(owner);
  if (name != null && desc != null) {
    enclosingMethod = newNameType(name, desc);
  }
}
origin: org.glassfish.jersey.core/jersey-server

@Override
public void visitTryCatchBlock(final Label start, final Label end,
                final Label handler, final String type) {
  ++handlerCount;
  Handler h = new Handler();
  h.start = start;
  h.end = end;
  h.handler = handler;
  h.desc = type;
  h.type = type != null ? cw.newClass(type) : 0;
  if (lastHandler == null) {
    firstHandler = h;
  } else {
    lastHandler.next = h;
  }
  lastHandler = h;
}
origin: org.glassfish.jersey.core/jersey-server

  case Frame.OBJECT:
    stackMap.putByte(7).putShort(
        cw.newClass(cw.typeTable[v].strVal1));
    break;
  case Frame.UNINITIALIZED:
stackMap.putByte(7).putShort(cw.newClass(sb.toString()));
origin: org.glassfish.jersey.core/jersey-server

private void writeFrameType(final Object type) {
  if (type instanceof String) {
    stackMap.putByte(7).putShort(cw.newClass((String) type));
  } else if (type instanceof Integer) {
    stackMap.putByte(((Integer) type).intValue());
  } else {
    stackMap.putByte(8).putShort(((Label) type).position);
  }
}
origin: org.glassfish.jersey.core/jersey-server

this.exceptions = new int[exceptionCount];
for (int i = 0; i < exceptionCount; ++i) {
  this.exceptions[i] = cw.newClass(exceptions[i]);
origin: org.glassfish.jersey.core/jersey-server

/**
 * Adds a field reference to the constant pool of the class being build.
 * Does nothing if the constant pool already contains a similar item.
 *
 * @param owner
 *            the internal name of the field's owner class.
 * @param name
 *            the field's name.
 * @param desc
 *            the field's descriptor.
 * @return a new or already existing field reference item.
 */
Item newFieldItem(final String owner, final String name, final String desc) {
  key3.set(FIELD, owner, name, desc);
  Item result = get(key3);
  if (result == null) {
    put122(FIELD, newClass(owner), newNameType(name, desc));
    result = new Item(index++, key3);
    put(result);
  }
  return result;
}
origin: org.glassfish.jersey.core/jersey-server

/**
 * Adds a method reference to the constant pool of the class being build.
 * Does nothing if the constant pool already contains a similar item.
 *
 * @param owner
 *            the internal name of the method's owner class.
 * @param name
 *            the method's name.
 * @param desc
 *            the method's descriptor.
 * @param itf
 *            <tt>true</tt> if <tt>owner</tt> is an interface.
 * @return a new or already existing method reference item.
 */
Item newMethodItem(final String owner, final String name,
          final String desc, final boolean itf) {
  int type = itf ? IMETH : METH;
  key3.set(type, owner, name, desc);
  Item result = get(key3);
  if (result == null) {
    put122(type, newClass(owner), newNameType(name, desc));
    result = new Item(index++, key3);
    put(result);
  }
  return result;
}
origin: com.sun.jersey/jersey-bundle

@Override
public final void visitOuterClass(final String owner, final String name,
    final String desc) {
  enclosingMethodOwner = newClass(owner);
  if (name != null && desc != null) {
    enclosingMethod = newNameType(name, desc);
  }
}
origin: eclipse-ee4j/jersey

@Override
public final void visitOuterClass(final String owner, final String name,
                 final String desc) {
  enclosingMethodOwner = newClass(owner);
  if (name != null && desc != null) {
    enclosingMethod = newNameType(name, desc);
  }
}
jersey.repackaged.org.objectweb.asmClassWriternewClass

Javadoc

Adds a class reference to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters.

Popular methods of ClassWriter

  • toByteArray
    Returns the bytecode of the class that was build with this class writer.
  • addType
    Adds the given Item to #typeTable.
  • addUninitializedType
    Adds the given "uninitialized" type to #typeTable and returns its index. This method is used for UNI
  • get
    Returns the constant pool's hash table item which is equal to the given item.
  • getCommonSuperClass
    Returns the common super type of the two given types. The default implementation of this method load
  • getMergedType
    Returns the index of the common super type of the two given types. This method calls #getCommonSuper
  • newClassItem
    Adds a class reference to the constant pool of the class being build. Does nothing if the constant p
  • newConst
    Adds a number or string constant to the constant pool of the class being build. Does nothing if the
  • newConstItem
    Adds a number or string constant to the constant pool of the class being build. Does nothing if the
  • newDouble
    Adds a double to the constant pool of the class being build. Does nothing if the constant pool alrea
  • newField
    Adds a field reference to the constant pool of the class being build. Does nothing if the constant p
  • newFieldItem
    Adds a field reference to the constant pool of the class being build. Does nothing if the constant p
  • newField,
  • newFieldItem,
  • newFloat,
  • newHandle,
  • newHandleItem,
  • newInteger,
  • newInvokeDynamicItem,
  • newLong,
  • newMethod

Popular in Java

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • onRequestPermissionsResult (Fragment)
  • onCreateOptionsMenu (Activity)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now