|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.binding.classes.ClassItem
public class ClassItem
Wrapper for field or method information. Provides the information needed for access to either existing or added methods in existing classes.
Field Summary | |
---|---|
private static java.lang.String[] |
EMPTY_STRING_ARRAY
Empty array of strings. |
private java.lang.String[] |
m_argTypes
Argument types for method. |
private ClassFile |
m_classFile
Owning class information. |
private org.apache.bcel.classfile.FieldOrMethod |
m_item
Wrapped existing item. |
private java.lang.String |
m_name
Item name. |
private java.lang.String |
m_signature
Encoded signature. |
private java.lang.String |
m_typeName
Fully qualified class name of item type. |
private static java.util.HashMap |
s_primitiveMap
Map for primitive type signature variants. |
private static java.util.HashMap |
s_signatureParamsMap
Map from method signature to array of argument types. |
private static java.util.HashMap |
s_signatureTypeMap
Map from method signature to return type. |
private static java.util.HashMap |
s_typeMap
Map from type name to BCEL type. |
private static byte |
SIGNATURE_ATTRIBUTE_TAG
Tag value for signature attribute. |
Constructor Summary | |
---|---|
ClassItem(java.lang.String name,
ClassFile cf,
org.apache.bcel.classfile.FieldOrMethod item)
Constructor. |
Method Summary | |
---|---|
static ClassItem |
findStaticMethod(java.lang.String name,
java.lang.String[] sigs)
Get static method by fully qualified name. |
static ClassItem |
findVirtualMethod(java.lang.String name,
java.lang.String[] sigs)
Get virtual method by fully qualified name. |
int |
getAccessFlags()
Get access flags. |
int |
getArgumentCount()
Get number of arguments for method. |
java.lang.String |
getArgumentType(int index)
Get argument type as fully qualified class name. |
java.lang.String[] |
getArgumentTypes()
Get argument types as array of fully qualified class names. |
ClassFile |
getClassFile()
Get owning class information. |
java.lang.String[] |
getExceptions()
Get names of exceptions thrown by method. |
java.lang.String |
getGenericsSignature()
Get the generics signature information for item. |
java.lang.String |
getName()
Get item name. |
java.lang.String |
getParameterName(int index)
Get method parameter name. |
static java.lang.String[] |
getParametersFromSignature(java.lang.String sig)
Get parameter type names from method signature. |
static java.lang.String |
getPrimitiveSignature(java.lang.String type)
Get the signature for a primitive. |
java.lang.String |
getSignature()
Get method signature. |
static java.lang.String[] |
getSignatureVariants(java.lang.String name)
Get all variant signatures for a fully qualified class name. |
static java.lang.String |
getTypeFromSignature(java.lang.String sig)
Get return type names from method signature. |
java.lang.String |
getTypeName()
Get item type as fully qualified class name. |
static boolean |
isAssignable(java.lang.String from,
java.lang.String to)
Check if a value of one type can be directly assigned to another type. |
boolean |
isInitializer()
Check if item is an initializer. |
boolean |
isMethod()
Check if item is a method. |
static boolean |
isPrimitive(java.lang.String type)
Check if type name is a primitive. |
boolean |
isStatic()
Check if item is a static. |
void |
makeAccessible(ClassFile src)
Make accessible item. |
void |
setAccessFlags(int flags)
Set access flags. |
static org.apache.bcel.generic.Type |
typeFromName(java.lang.String name)
Create type from name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String[] EMPTY_STRING_ARRAY
private static final byte SIGNATURE_ATTRIBUTE_TAG
private static java.util.HashMap s_primitiveMap
private static java.util.HashMap s_typeMap
private static java.util.HashMap s_signatureParamsMap
private static java.util.HashMap s_signatureTypeMap
private ClassFile m_classFile
private java.lang.String m_name
private java.lang.String m_signature
private java.lang.String m_typeName
private java.lang.String[] m_argTypes
private org.apache.bcel.classfile.FieldOrMethod m_item
Constructor Detail |
---|
public ClassItem(java.lang.String name, ClassFile cf, org.apache.bcel.classfile.FieldOrMethod item)
name
- field or method namecf
- owning class informationitem
- field or method informationMethod Detail |
---|
public ClassFile getClassFile()
public java.lang.String getName()
public java.lang.String getTypeName()
public int getArgumentCount()
public java.lang.String getArgumentType(int index)
index
- argument number
public java.lang.String getParameterName(int index)
public java.lang.String[] getArgumentTypes()
public int getAccessFlags()
public void setAccessFlags(int flags)
flags
- access flags for field or methodpublic void makeAccessible(ClassFile src) throws JiBXException
src
- class file for required access
JiBXException
- if cannot be accessedpublic boolean isStatic()
true
if a static, false
if memberpublic java.lang.String getSignature()
public boolean isMethod()
true
if a method, false
if a fieldpublic boolean isInitializer()
true
if an initializer, false
if a
field or normal methodpublic java.lang.String[] getExceptions()
null
if
a fieldpublic java.lang.String getGenericsSignature()
null
if none)public static boolean isPrimitive(java.lang.String type)
true
if a primitive, false
if notpublic static java.lang.String getPrimitiveSignature(java.lang.String type)
public static java.lang.String[] getParametersFromSignature(java.lang.String sig)
sig
- method signature to be decoded
public static java.lang.String getTypeFromSignature(java.lang.String sig)
sig
- method signature to be decoded
public static org.apache.bcel.generic.Type typeFromName(java.lang.String name)
name
- fully qualified type name
public static ClassItem findVirtualMethod(java.lang.String name, java.lang.String[] sigs) throws JiBXException
name
- fully qualified class and method namesigs
- possible method signatures
null
if not found
JiBXException
- if configuration errorpublic static ClassItem findStaticMethod(java.lang.String name, java.lang.String[] sigs) throws JiBXException
name
- fully qualified class and method namesigs
- possible method signatures
null
if not found
JiBXException
- if configuration errorpublic static java.lang.String[] getSignatureVariants(java.lang.String name) throws JiBXException
name
- fully qualified class name
JiBXException
- if configuration errorpublic static boolean isAssignable(java.lang.String from, java.lang.String to) throws JiBXException
from
- fully qualified class name of initial typeto
- fully qualified class name of assignment type
true
if assignable, false
if not
JiBXException
- if configuration error
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |