congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.apache.bcel.generic
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.bcel.generic

Best Java code snippets using org.apache.bcel.generic (Showing top 20 results out of 315)

origin: xalan/xalan

public static void compileStripSpace(BranchHandle strip[], 
         int sCount,
         InstructionList il) {
final InstructionHandle target = il.append(ICONST_1);
il.append(IRETURN);
for (int i = 0; i < sCount; i++) {
  strip[i].setTarget(target);
}
}
origin: xalan/xalan

public RtMethodGenerator(int access_flags, Type return_type,
       Type[] arg_types, String[] arg_names,
       String method_name, String class_name,
       InstructionList il, ConstantPoolGen cp) {
super(access_flags, return_type, arg_types, arg_names, method_name, 
   class_name, il, cp);

_astoreHandler = new ASTORE(HANDLER_INDEX);
_aloadHandler  = new ALOAD(HANDLER_INDEX);
}
origin: xalan/xalan

  public BranchInstruction LE(boolean tozero) {
  return tozero ? (BranchInstruction) new IFLE(null) : 
    (BranchInstruction) new IF_ICMPLE(null);
  }
}
origin: xalan/xalan

public AttributeSetMethodGenerator(String methodName, ClassGen classGen) {
super(org.apache.bcel.Constants.ACC_PRIVATE,
   org.apache.bcel.generic.Type.VOID,
   argTypes, argNames, methodName, 
   classGen.getClassName(),
   new InstructionList(),
   classGen.getConstantPool());

_aloadDom       = new ALOAD(DOM_INDEX);
_astoreDom      = new ASTORE(DOM_INDEX);
_astoreIterator = new ASTORE(ITERATOR_INDEX);
_aloadIterator  = new ALOAD(ITERATOR_INDEX);
_astoreHandler  = new ASTORE(HANDLER_INDEX);
_aloadHandler   = new ALOAD(HANDLER_INDEX);
}
origin: xalan/xalan

/**
 * Translates an object of this type to its unboxed representation.
 */ 
public void translateUnBox(ClassGenerator classGen,
        MethodGenerator methodGen) {
final ConstantPoolGen cpg = classGen.getConstantPool();
final InstructionList il = methodGen.getInstructionList();
il.append(new CHECKCAST(cpg.addClass(BOOLEAN_CLASS)));
il.append(new INVOKEVIRTUAL(cpg.addMethodref(BOOLEAN_CLASS,
             BOOLEAN_VALUE, 
             BOOLEAN_VALUE_SIG)));
}
origin: xalan/xalan

/**
 * Translates an object of this type to its unboxed representation.
 */ 
public void translateUnBox(ClassGenerator classGen,
        MethodGenerator methodGen) {
final ConstantPoolGen cpg = classGen.getConstantPool();
final InstructionList il = methodGen.getInstructionList();
il.append(new CHECKCAST(cpg.addClass(RUNTIME_NODE_CLASS)));
il.append(new GETFIELD(cpg.addFieldref(RUNTIME_NODE_CLASS,
            NODE_FIELD,
            NODE_FIELD_SIG)));
}
origin: xalan/xalan

  /**
   * Translate code to call the BasisLibrary.unallowed_extensionF(String)
   * method.
   */
  private void translateUnallowedExtension(ConstantPoolGen cpg,
                       InstructionList il) {
  int index = cpg.addMethodref(BASIS_LIBRARY_CLASS,
           "unallowed_extension_functionF",
           "(Ljava/lang/String;)V");
  il.append(new PUSH(cpg, _fname.toString()));
  il.append(new INVOKESTATIC(index));   
  }      
}
origin: xalan/xalan

public TestGenerator(int access_flags, Type return_type,
     Type[] arg_types, String[] arg_names,
     String method_name, String class_name,
     InstructionList il, ConstantPoolGen cp) {
super(access_flags, return_type, arg_types, arg_names, method_name, 
   class_name, il, cp);

_iloadCurrent  = new ILOAD(CURRENT_NODE_INDEX);
_istoreCurrent = new ISTORE(CURRENT_NODE_INDEX);
_iloadContext  = new ILOAD(CONTEXT_NODE_INDEX);
_istoreContext  = new ILOAD(CONTEXT_NODE_INDEX);
_astoreIterator = new ASTORE(ITERATOR_INDEX);
_aloadIterator  = new ALOAD(ITERATOR_INDEX);
}
origin: xalan/xalan

public MatchGenerator(int access_flags, Type return_type, 
     Type[] arg_types, String[] arg_names, 
     String method_name, String class_name,
     InstructionList il, ConstantPoolGen cp) {
super(access_flags, return_type, arg_types, arg_names, method_name, 
   class_name, il, cp);

_iloadCurrent = new ILOAD(CURRENT_INDEX);
_istoreCurrent = new ISTORE(CURRENT_INDEX);
}
origin: spotbugs/spotbugs

/**
 * Return whether the given FieldInstruction accesses a long or double
 * field.
 *
 * @param fieldIns
 *            the FieldInstruction
 * @param cpg
 *            the ConstantPoolGen for the method
 */
protected static boolean isLongOrDouble(FieldInstruction fieldIns, ConstantPoolGen cpg) {
  Type type = fieldIns.getFieldType(cpg);
  int code = type.getType();
  return code == Const.T_LONG || code == Const.T_DOUBLE;
}
origin: xalan/xalan

public BranchInstruction LT(boolean tozero) {
return tozero ? (BranchInstruction) new IFLT(null) : 
  (BranchInstruction) new IF_ICMPLT(null);
}
origin: xalan/xalan

public BranchInstruction GT(boolean tozero) {
return tozero ? (BranchInstruction) new IFGT(null) : 
  (BranchInstruction) new IF_ICMPGT(null);
}
origin: xalan/xalan

public BranchInstruction GE(boolean tozero) {
return tozero ? (BranchInstruction) new IFGE(null) : 
  (BranchInstruction) new IF_ICMPGE(null);
}
origin: spotbugs/spotbugs

/**
 * Determine if the given ObjectType reference represents a
 * <em>universal</em> exception handler. That is, one that will catch any
 * kind of exception.
 *
 * @param catchType
 *            the ObjectType of the exception handler
 * @return true if catchType is null, or if catchType is java.lang.Throwable
 */
public static boolean isUniversalExceptionHandler(ObjectType catchType) {
  return catchType == null || catchType.equals(Type.THROWABLE);
}
origin: spotbugs/spotbugs

private static boolean internalIsSynthetic(final FieldGenOrMethodGen m) {
  if (m.isSynthetic()) {
    return true;
  }
  for (final Attribute a : m.getAttributes()) {
    if (a instanceof Synthetic) {
      return true;
    }
  }
  return false;
}
origin: xalan/xalan

public static void compilePreserveSpace(BranchHandle preserve[], 
          int pCount,
          InstructionList il) {
final InstructionHandle target = il.append(ICONST_0);
il.append(IRETURN);
for (int i = 0; i < pCount; i++) {
  preserve[i].setTarget(target);
}
}
origin: xalan/xalan

  public BranchInstruction LE(boolean tozero) {
  return tozero ? (BranchInstruction) new IFLE(null) : 
    (BranchInstruction) new IF_ICMPLE(null);
  }
}
origin: xalan/xalan

public BranchInstruction LT(boolean tozero) {
return tozero ? (BranchInstruction) new IFLT(null) : 
  (BranchInstruction) new IF_ICMPLT(null);
}
origin: xalan/xalan

public BranchInstruction GT(boolean tozero) {
return tozero ? (BranchInstruction) new IFGT(null) : 
  (BranchInstruction) new IF_ICMPGT(null);
}
origin: xalan/xalan

public BranchInstruction GE(boolean tozero) {
return tozero ? (BranchInstruction) new IFGE(null) : 
  (BranchInstruction) new IF_ICMPGE(null);
}
org.apache.bcel.generic

Most used classes

  • InstructionList
    This class is a container for a list of Instruction [Instruction.html] objects. Instructions can be
  • ClassGen
    Template class for building up a java class. May be initialized with an existing java class (file).
  • MethodGen
    Template class for building up a method. This is done by defining exception handlers, adding thrown
  • ObjectType
    Denotes reference such as java.lang.String.
  • Type
    Abstract super class for all possible java types, namely basic types such as int, object types like
  • InstructionHandle,
  • ALOAD,
  • ASTORE,
  • FieldGen,
  • INVOKESPECIAL,
  • INVOKEVIRTUAL,
  • ArrayType,
  • NEW,
  • GOTO,
  • PUSH,
  • ILOAD,
  • CHECKCAST,
  • GETSTATIC,
  • ISTORE
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