*/
public interface Constants {
-
-
-
-
- /** One of the access flags for fields, methods, or classes.
+ /** One of the access flags for fields, methods, or classes.
* @see #ACC_PUBLIC
*/
public final static short ACC_FINAL = 0x0010;
* @see <a href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode definitions in The Java Virtual Machine Specification</a> */
public static final short JSR_W = 201;
-
-
-
-
-
/** Illegal opcode. */
public static final short UNDEFINED = -1;
/** Illegal opcode. */
/** Mnemonic for an illegal type. */
public static final String ILLEGAL_TYPE = "<illegal type>";
- /** Boolean data type. */
- public static final byte T_BOOLEAN = 4;
- /** Char data type. */
- public static final byte T_CHAR = 5;
- /** Float data type. */
- public static final byte T_FLOAT = 6;
- /** Double data type. */
- public static final byte T_DOUBLE = 7;
/** Byte data type. */
public static final byte T_BYTE = 8;
/** Short data type. */
public static final byte T_SHORT = 9;
/** Int data type. */
public static final byte T_INT = 10;
- /** Long data type. */
- public static final byte T_LONG = 11;
- /** Void data type (non-standard). */
- public static final byte T_VOID = 12; // Non-standard
-
/** Object data type. */
public static final byte T_OBJECT = 14;
/** Unknown data type. */
public static final byte T_UNKNOWN = 15;
-
/** The primitive type names corresponding to the T_XX constants,
* e.g., TYPE_NAMES[T_INT] = "int"
"void", "array", "object", "unknown", "address"
};
- /** The signature characters corresponding to primitive types,
- * e.g., SHORT_TYPE_NAMES[T_INT] = "I"
- */
- public static final String[] SHORT_TYPE_NAMES = {
- ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE,
- "Z", "C", "F", "D", "B", "S", "I", "J",
- "V", ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE
- };
+
/**
* Number of byte code operands for each opcode, i.e., number of bytes after the tag byte
* should see the <a href="../generic/ClassGen.html">ClassGen</a> class.
* @version $Id$
- * @see org.apache.tomcat.util.bcel.generic.ClassGen
* @author <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A>
*/
public class JavaClass extends AccessFlags implements Cloneable, Comparable {
private Attribute[] attributes; // attributes defined in the class
private AnnotationEntry[] annotations; // annotations defined on the class
- public static final byte FILE = 2;
- public static final byte ZIP = 3;
+
+
+++ /dev/null
-/*
- * Copyright 2000-2009 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.tomcat.util.bcel.generic;
-
-import org.apache.tomcat.util.bcel.Constants;
-
-/**
- * Denotes basic type such as int.
- *
- * @version $Id$
- * @author <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A>
- */
-public final class BasicType extends Type {
-
- /**
- * Constructor for basic types such as int, long, `void'
- *
- * @param type one of T_INT, T_BOOLEAN, ..., T_VOID
- * @see org.apache.tomcat.util.bcel.Constants
- */
- BasicType(byte type) {
- super(type, Constants.SHORT_TYPE_NAMES[type]);
- if ((type < Constants.T_BOOLEAN) || (type > Constants.T_VOID)) {
- throw new ClassGenException("Invalid type: " + type);
- }
- }
-
-
-
-
-
- /** @return a hash code value for the object.
- */
- public int hashCode() {
- return type;
- }
-
-
- /** @return true if both type objects refer to the same type
- */
- public boolean equals( Object _type ) {
- return (_type instanceof BasicType) ? ((BasicType) _type).type == this.type : false;
- }
-}
+++ /dev/null
-/*
- * Copyright 2000-2009 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.tomcat.util.bcel.generic;
-
-import org.apache.tomcat.util.bcel.classfile.AccessFlags;
-import org.apache.tomcat.util.bcel.classfile.JavaClass;
-import org.apache.tomcat.util.bcel.util.BCELComparator;
-
-/**
- * Template class for building up a java class. May be initialized with an
- * existing java class (file).
- *
- * @see JavaClass
- * @version $Id$
- * @author <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A>
- */
-public class ClassGen extends AccessFlags implements Cloneable {
-
- /* Corresponds to the fields found in a JavaClass object.
- */
- private String class_name;
-
- private static BCELComparator _cmp = new BCELComparator() {
-
- public boolean equals( Object o1, Object o2 ) {
- ClassGen THIS = (ClassGen) o1;
- ClassGen THAT = (ClassGen) o2;
- return THIS.getClassName().equals(THAT.getClassName());
- }
-
-
- public int hashCode( Object o ) {
- ClassGen THIS = (ClassGen) o;
- return THIS.getClassName().hashCode();
- }
- };
-
-
- public String getClassName() {
- return class_name;
- }
-
-
- public Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException e) {
- System.err.println(e);
- return null;
- }
- }
-
-
- /**
- * Return value as defined by given BCELComparator strategy.
- * By default two ClassGen objects are said to be equal when
- * their class names are equal.
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals( Object obj ) {
- return _cmp.equals(this, obj);
- }
-
-
- /**
- * Return value as defined by given BCELComparator strategy.
- * By default return the hashcode of the class name.
- *
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return _cmp.hashCode(this);
- }
-}
protected int[] match; // matches, i.e., case 1: ...
protected int[] indices; // target offsets
protected InstructionHandle[] targets; // target objects in instruction list
- protected int fixed_length; // fixed length defined by subclasses
+
protected int match_length; // number of cases
protected int padding = 0; // number of pad bytes for alignment