public class SClassReader
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SClassReader.AnnotatedEntity
Entity with optional annotations
|
static class |
SClassReader.AnnotationInfo
Class containing annotation infos.
|
static class |
SClassReader.ClassEntity
Entity contained in a class.
|
static class |
SClassReader.ClassFileInfo
Class for infos about a class with full filename.
|
static class |
SClassReader.ClassInfo
Class for infos about a class.
|
static class |
SClassReader.EnumInfo
Info object for an enum.
|
static class |
SClassReader.FieldInfo
Info object describing a field.
|
static class |
SClassReader.MethodInfo
Info object describing a method.
|
Modifier and Type | Field and Description |
---|---|
protected static java.util.Map<java.lang.String,java.lang.String> |
BASE_TYPE_MAP |
protected static java.util.Map<java.lang.ClassLoader,java.util.Map<java.lang.String,SClassReader.ClassInfo>> |
CI_NAME_CACHE |
Constructor and Description |
---|
SClassReader() |
Modifier and Type | Method and Description |
---|---|
protected static java.lang.String |
convertTypeName(java.lang.String type)
Converts a type name to Java style.
|
protected static java.lang.String |
decodeModifiedUtf8(byte[] data)
Decodes a Java-style modified UTF8 string as used
in class files.
|
static SClassReader.ClassInfo |
getClassInfo(java.io.InputStream inputstream)
Get infos about a class.
|
static SClassReader.ClassInfo |
getClassInfo(java.io.InputStream inputstream,
boolean includefields,
boolean includemethods)
Get infos about a class.
|
static SClassReader.ClassInfo |
getClassInfo(java.lang.String classname,
java.lang.ClassLoader cl) |
static SClassReader.ClassInfo |
getClassInfo(java.lang.String classname,
java.lang.ClassLoader cl,
boolean includefields,
boolean includemethods) |
static SClassReader.ClassInfo |
getClassInfo(java.lang.String cachekey,
java.io.InputStream inputstream,
java.util.Date lastmodified)
Get infos about a class.
|
protected static SClassReader.AnnotationInfo |
readAnnotation(java.io.DataInputStream is,
java.util.Map<java.lang.Integer,byte[]> strings)
Read a specific annotation.
|
protected static java.util.List<SClassReader.AnnotationInfo> |
readAnnotations(java.io.DataInputStream is,
java.util.Map<java.lang.Integer,byte[]> strings)
Read a set of annotations.
|
protected static java.lang.Object |
readAnnotationValue(java.io.DataInputStream is,
java.util.Map<java.lang.Integer,byte[]> strings)
Read an annotation value.
|
protected static java.util.Map<java.lang.Integer,byte[]> |
readConstantPoolStrings(java.io.DataInputStream is)
Reads strings from the constant pool.
|
protected static java.util.List<SClassReader.FieldInfo> |
readFields(java.io.DataInputStream is,
java.util.Map<java.lang.Integer,byte[]> strings)
Reads the class fields.
|
protected static java.util.List<SClassReader.MethodInfo> |
readMethods(java.io.DataInputStream is,
java.util.Map<java.lang.Integer,byte[]> strings)
Reads the class methods.
|
protected static java.util.List<SClassReader.AnnotationInfo> |
readVisibleAnnotations(java.io.DataInputStream is,
java.util.Map<java.lang.Integer,byte[]> strings,
boolean cancelread)
Read runtime visible annotations.
|
protected static void |
skip(java.io.DataInputStream is,
int len)
Skips a number of bytes.
|
protected static void |
skipAttributes(java.io.DataInputStream is) |
protected static void |
skipFieldsOrMethods(java.io.DataInputStream is)
Skips the field or method section of the class file.
|
protected static final java.util.Map<java.lang.ClassLoader,java.util.Map<java.lang.String,SClassReader.ClassInfo>> CI_NAME_CACHE
protected static final java.util.Map<java.lang.String,java.lang.String> BASE_TYPE_MAP
public static final SClassReader.ClassInfo getClassInfo(java.lang.String cachekey, java.io.InputStream inputstream, java.util.Date lastmodified)
inputstream
- The input stream of the class file.public static final SClassReader.ClassInfo getClassInfo(java.io.InputStream inputstream)
inputstream
- The input stream of the class file.public static final SClassReader.ClassInfo getClassInfo(java.lang.String classname, java.lang.ClassLoader cl)
public static final SClassReader.ClassInfo getClassInfo(java.lang.String classname, java.lang.ClassLoader cl, boolean includefields, boolean includemethods)
public static final SClassReader.ClassInfo getClassInfo(java.io.InputStream inputstream, boolean includefields, boolean includemethods)
inputstream
- The input stream of the class file.protected static final java.util.Map<java.lang.Integer,byte[]> readConstantPoolStrings(java.io.DataInputStream is) throws java.io.IOException
is
- The input stream.java.io.IOException
protected static final void skipFieldsOrMethods(java.io.DataInputStream is) throws java.io.IOException
is
- The input stream.strings
- java.io.IOException
protected static final void skipAttributes(java.io.DataInputStream is) throws java.io.IOException
java.io.IOException
protected static final java.util.List<SClassReader.FieldInfo> readFields(java.io.DataInputStream is, java.util.Map<java.lang.Integer,byte[]> strings) throws java.io.IOException
is
- Inputstream.strings
- Strings from constant table.java.io.IOException
protected static final java.util.List<SClassReader.MethodInfo> readMethods(java.io.DataInputStream is, java.util.Map<java.lang.Integer,byte[]> strings) throws java.io.IOException
is
- Inputstream.strings
- Strings from constant table.java.io.IOException
protected static final java.util.List<SClassReader.AnnotationInfo> readVisibleAnnotations(java.io.DataInputStream is, java.util.Map<java.lang.Integer,byte[]> strings, boolean cancelread) throws java.io.IOException
java.io.IOException
protected static final java.util.List<SClassReader.AnnotationInfo> readAnnotations(java.io.DataInputStream is, java.util.Map<java.lang.Integer,byte[]> strings) throws java.io.IOException
java.io.IOException
protected static final SClassReader.AnnotationInfo readAnnotation(java.io.DataInputStream is, java.util.Map<java.lang.Integer,byte[]> strings) throws java.io.IOException
java.io.IOException
protected static final java.lang.Object readAnnotationValue(java.io.DataInputStream is, java.util.Map<java.lang.Integer,byte[]> strings) throws java.io.IOException
java.io.IOException
protected static final java.lang.String decodeModifiedUtf8(byte[] data)
data
- The string data.protected static final void skip(java.io.DataInputStream is, int len) throws java.io.IOException
is
- Inputstream.len
- number of bytes skipped.java.io.IOException
protected static final java.lang.String convertTypeName(java.lang.String type)
type
- Internal name.