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

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

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

origin: com.sun.jersey/jersey-server

/**
 * Adds a class reference to the constant pool of the class being build.
 * Does nothing if the constant pool already contains a similar item.
 * <i>This method is intended for {@link Attribute} sub classes, and is
 * normally not needed by class generators or adapters.</i>
 *
 * @param value
 *            the internal name of the class.
 * @return the index of a new or already existing class reference item.
 */
public int newClass(final String value) {
  return newClassItem(value).index;
}
origin: com.sun.jersey/jersey-server

@Override
public void visitTypeInsn(final int opcode, final String type) {
  lastCodeOffset = code.length;
  Item i = cw.newClassItem(type);
  // Label currentBlock = this.currentBlock;
  if (currentBlock != null) {
    if (compute == FRAMES) {
      currentBlock.frame.execute(opcode, code.length, cw, i);
    } else if (opcode == Opcodes.NEW) {
      // updates current and max stack sizes only if opcode == NEW
      // (no stack change for ANEWARRAY, CHECKCAST, INSTANCEOF)
      int size = stackSize + 1;
      if (size > maxStackSize) {
        maxStackSize = size;
      }
      stackSize = size;
    }
  }
  // adds the instruction to the bytecode of the method
  code.put12(opcode, i.index);
}
origin: com.sun.jersey/jersey-server

@Override
public void visitMultiANewArrayInsn(final String desc, final int dims) {
  lastCodeOffset = code.length;
  Item i = cw.newClassItem(desc);
  // Label currentBlock = this.currentBlock;
  if (currentBlock != null) {
    if (compute == FRAMES) {
      currentBlock.frame.execute(Opcodes.MULTIANEWARRAY, dims, cw, i);
    } else {
      // updates current stack size (max stack size unchanged because
      // stack size variation always negative or null)
      stackSize += 1 - dims;
    }
  }
  // adds the instruction to the bytecode of the method
  code.put12(Opcodes.MULTIANEWARRAY, i.index).putByte(dims);
}
origin: com.sun.jersey/jersey-server

int s = t.getSort();
if (s == Type.OBJECT) {
  return newClassItem(t.getInternalName());
} else if (s == Type.METHOD) {
  return newMethodTypeItem(t.getDescriptor());
} else { // s == primitive type or array
  return newClassItem(t.getDescriptor());
origin: org.glassfish.jersey.core/jersey-server

/**
 * Adds a class reference to the constant pool of the class being build.
 * Does nothing if the constant pool already contains a similar item.
 * <i>This method is intended for {@link Attribute} sub classes, and is
 * normally not needed by class generators or adapters.</i>
 *
 * @param value
 *            the internal name of the class.
 * @return the index of a new or already existing class reference item.
 */
public int newClass(final String value) {
  return newClassItem(value).index;
}
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: org.glassfish.jersey.core/jersey-server

@Override
public void visitTypeInsn(final int opcode, final String type) {
  lastCodeOffset = code.length;
  Item i = cw.newClassItem(type);
  // Label currentBlock = this.currentBlock;
  if (currentBlock != null) {
    if (compute == FRAMES) {
      currentBlock.frame.execute(opcode, code.length, cw, i);
    } else if (opcode == Opcodes.NEW) {
      // updates current and max stack sizes only if opcode == NEW
      // (no stack change for ANEWARRAY, CHECKCAST, INSTANCEOF)
      int size = stackSize + 1;
      if (size > maxStackSize) {
        maxStackSize = size;
      }
      stackSize = size;
    }
  }
  // adds the instruction to the bytecode of the method
  code.put12(opcode, i.index);
}
origin: org.glassfish.jersey.core/jersey-server

@Override
public void visitMultiANewArrayInsn(final String desc, final int dims) {
  lastCodeOffset = code.length;
  Item i = cw.newClassItem(desc);
  // Label currentBlock = this.currentBlock;
  if (currentBlock != null) {
    if (compute == FRAMES) {
      currentBlock.frame.execute(Opcodes.MULTIANEWARRAY, dims, cw, i);
    } else {
      // updates current stack size (max stack size unchanged because
      // stack size variation always negative or null)
      stackSize += 1 - dims;
    }
  }
  // adds the instruction to the bytecode of the method
  code.put12(Opcodes.MULTIANEWARRAY, i.index).putByte(dims);
}
origin: org.glassfish.jersey.core/jersey-server

int s = t.getSort();
if (s == Type.OBJECT) {
  return newClassItem(t.getInternalName());
} else if (s == Type.METHOD) {
  return newMethodTypeItem(t.getDescriptor());
} else { // s == primitive type or array
  return newClassItem(t.getDescriptor());
origin: com.sun.jersey/jersey-bundle

/**
 * Adds a class reference to the constant pool of the class being build.
 * Does nothing if the constant pool already contains a similar item.
 * <i>This method is intended for {@link Attribute} sub classes, and is
 * normally not needed by class generators or adapters.</i>
 *
 * @param value
 *            the internal name of the class.
 * @return the index of a new or already existing class reference item.
 */
public int newClass(final String value) {
  return newClassItem(value).index;
}
origin: org.glassfish.jersey.bundles/jaxrs-ri

/**
 * Adds a class reference to the constant pool of the class being build.
 * Does nothing if the constant pool already contains a similar item.
 * <i>This method is intended for {@link Attribute} sub classes, and is
 * normally not needed by class generators or adapters.</i>
 *
 * @param value
 *            the internal name of the class.
 * @return the index of a new or already existing class reference item.
 */
public int newClass(final String value) {
  return newClassItem(value).index;
}
origin: eclipse-ee4j/jersey

/**
 * Adds a class reference to the constant pool of the class being build.
 * Does nothing if the constant pool already contains a similar item.
 * <i>This method is intended for {@link Attribute} sub classes, and is
 * normally not needed by class generators or adapters.</i>
 *
 * @param value
 *            the internal name of the class.
 * @return the index of a new or already existing class reference item.
 */
public int newClass(final String value) {
  return newClassItem(value).index;
}
origin: eclipse-ee4j/jersey

/**
 * Adds a class reference to the constant pool of the class being build.
 * Does nothing if the constant pool already contains a similar item.
 * <i>This method is intended for {@link Attribute} sub classes, and is
 * normally not needed by class generators or adapters.</i>
 *
 * @param value
 *            the internal name of the class.
 * @return the index of a new or already existing class reference item.
 */
public int newClass(final String value) {
  return newClassItem(value).index;
}
origin: jersey/jersey-1.x

/**
 * Adds a class reference to the constant pool of the class being build.
 * Does nothing if the constant pool already contains a similar item.
 * <i>This method is intended for {@link Attribute} sub classes, and is
 * normally not needed by class generators or adapters.</i>
 *
 * @param value
 *            the internal name of the class.
 * @return the index of a new or already existing class reference item.
 */
public int newClass(final String value) {
  return newClassItem(value).index;
}
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-bundle

@Override
public void visitMultiANewArrayInsn(final String desc, final int dims) {
  lastCodeOffset = code.length;
  Item i = cw.newClassItem(desc);
  // Label currentBlock = this.currentBlock;
  if (currentBlock != null) {
    if (compute == FRAMES) {
      currentBlock.frame.execute(Opcodes.MULTIANEWARRAY, dims, cw, i);
    } else {
      // updates current stack size (max stack size unchanged because
      // stack size variation always negative or null)
      stackSize += 1 - dims;
    }
  }
  // adds the instruction to the bytecode of the method
  code.put12(Opcodes.MULTIANEWARRAY, i.index).putByte(dims);
}
origin: eclipse-ee4j/jersey

@Override
public void visitMultiANewArrayInsn(final String desc, final int dims) {
  lastCodeOffset = code.length;
  Item i = cw.newClassItem(desc);
  // Label currentBlock = this.currentBlock;
  if (currentBlock != null) {
    if (compute == FRAMES) {
      currentBlock.frame.execute(Opcodes.MULTIANEWARRAY, dims, cw, i);
    } else {
      // updates current stack size (max stack size unchanged because
      // stack size variation always negative or null)
      stackSize += 1 - dims;
    }
  }
  // adds the instruction to the bytecode of the method
  code.put12(Opcodes.MULTIANEWARRAY, i.index).putByte(dims);
}
origin: org.glassfish.jersey.bundles/jaxrs-ri

@Override
public void visitMultiANewArrayInsn(final String desc, final int dims) {
  lastCodeOffset = code.length;
  Item i = cw.newClassItem(desc);
  // Label currentBlock = this.currentBlock;
  if (currentBlock != null) {
    if (compute == FRAMES) {
      currentBlock.frame.execute(Opcodes.MULTIANEWARRAY, dims, cw, i);
    } else {
      // updates current stack size (max stack size unchanged because
      // stack size variation always negative or null)
      stackSize += 1 - dims;
    }
  }
  // adds the instruction to the bytecode of the method
  code.put12(Opcodes.MULTIANEWARRAY, i.index).putByte(dims);
}
origin: eclipse-ee4j/jersey

@Override
public void visitMultiANewArrayInsn(final String desc, final int dims) {
  lastCodeOffset = code.length;
  Item i = cw.newClassItem(desc);
  // Label currentBlock = this.currentBlock;
  if (currentBlock != null) {
    if (compute == FRAMES) {
      currentBlock.frame.execute(Opcodes.MULTIANEWARRAY, dims, cw, i);
    } else {
      // updates current stack size (max stack size unchanged because
      // stack size variation always negative or null)
      stackSize += 1 - dims;
    }
  }
  // adds the instruction to the bytecode of the method
  code.put12(Opcodes.MULTIANEWARRAY, i.index).putByte(dims);
}
origin: jersey/jersey-1.x

@Override
public void visitMultiANewArrayInsn(final String desc, final int dims) {
  lastCodeOffset = code.length;
  Item i = cw.newClassItem(desc);
  // Label currentBlock = this.currentBlock;
  if (currentBlock != null) {
    if (compute == FRAMES) {
      currentBlock.frame.execute(Opcodes.MULTIANEWARRAY, dims, cw, i);
    } else {
      // updates current stack size (max stack size unchanged because
      // stack size variation always negative or null)
      stackSize += 1 - dims;
    }
  }
  // adds the instruction to the bytecode of the method
  code.put12(Opcodes.MULTIANEWARRAY, i.index).putByte(dims);
}
jersey.repackaged.org.objectweb.asmClassWriternewClassItem

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
  • newClass
    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

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • getSupportFragmentManager (FragmentActivity)
  • startActivity (Activity)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JFrame (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Join (org.hibernate.mapping)
  • Top plugins for WebStorm
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