Class AttributeReader
java.lang.Object
com.ibm.wala.shrike.shrikeCT.AttributeReader
- Direct Known Subclasses:
AnnotationsReader
,BootstrapMethodsReader
,CodeReader
,ConstantValueReader
,ExceptionsReader
,InnerClassesReader
,LineNumberTableReader
,LocalVariableTableReader
,SignatureReader
,SourceDebugExtensionReader
,SourceFileReader
,SourcePositionTableReader
,StackMapTableReader
This is a base class for "attribute readers", the classes which provide access to the contents of
attributes.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final int
protected final ClassReader
protected final int
-
Constructor Summary
ModifierConstructorDescriptionprotected
AttributeReader
(ClassReader.AttrIterator attr, String expectedName) Construct a reader for a particular attribute. -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
checkSize
(int offset, int len) Ensure that the len bytes starting at offset fall within the attribute data.protected final void
checkSizeEquals
(int offset, int len) Ensure that the len bytes starting at offset end at the end of the attribute data.final ClassReader
final int
final int
-
Field Details
-
cr
-
attr
protected final int attr -
length
protected final int length
-
-
Constructor Details
-
AttributeReader
protected AttributeReader(ClassReader.AttrIterator attr, String expectedName) throws InvalidClassFileException Construct a reader for a particular attribute.- Parameters:
attr
- a valid attribute iterator pointing at the attribute to readexpectedName
- the name the attribute must have- Throws:
InvalidClassFileException
-
-
Method Details
-
getClassReader
- Returns:
- the class reader the attribute belongs to
-
getRawOffset
public final int getRawOffset()- Returns:
- the offset of the raw attribute data (including the attribute header)
-
getRawSize
public final int getRawSize()- Returns:
- the size of the raw attribute data (including the attribute header)
-
checkSize
Ensure that the len bytes starting at offset fall within the attribute data.- Throws:
InvalidClassFileException
- if the bytes fall outside the data
-
checkSizeEquals
Ensure that the len bytes starting at offset end at the end of the attribute data.- Throws:
InvalidClassFileException
- if the bytes do not end at the end of the attribute
-