- java.lang.Object
-
- com.ibm.j9ddr.StructureReader
-
public class StructureReader extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StructureReader.ConstantDescriptor
static class
StructureReader.FieldDescriptor
static class
StructureReader.PackageNameType
static class
StructureReader.StructureDescriptor
-
Field Summary
Fields Modifier and Type Field Description static int
BIT_FIELD_CELL_SIZE
static byte
BIT_FIELD_FORMAT_BIG_ENDIAN
static byte
BIT_FIELD_FORMAT_LITTLE_ENDIAN
static String
DDR_VERSIONED_PACKAGE_PREFIX
static int
J9_STRUCTURES_EYECATCHER
static Class<?>[]
STRUCTURE_CONSTRUCTOR_SIGNATURE
static int
VERSION
-
Constructor Summary
Constructors Constructor Description StructureReader(InputStream in)
Read a stream in the J9DDRStructStore superset format.StructureReader(ImageInputStream in)
Initialize this reader from the supplied data.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCompatibilityConstants(InputStream inputStream)
void
addStructures(ImageInputStream ddrStream)
Add to the existing set of structures already contained in this reader.String
getBasePackage()
byte
getBitFieldFormat()
boolean
getBuildFlagValue(String structureName, String constantName, boolean defaultValue)
List<StructureReader.ConstantDescriptor>
getConstants(String structureName)
long
getConstantValue(String structureName, String constantName, long defaultValue)
List<StructureReader.FieldDescriptor>
getFields(String structureName)
Get a map of the fields for a particular structure and their offsets.StructureHeader
getHeader()
String
getPackageName(StructureReader.PackageNameType type)
Get the package name that should be used including the version informationlong
getPackageVersion()
Get the package version number, derived from fields of DDRAlgorithmVersions in the blob.byte[]
getPointerClassBytes(String binaryName)
byte
getSizeOfBool()
byte
getSizeOfUDATA()
byte[]
getStructureClassBytes(String binaryName)
Set<String>
getStructureNames()
Get a list of the structures defined by this readerCollection<StructureReader.StructureDescriptor>
getStructures()
int
getStructureSizeOf(String structureName)
boolean
hasStructure(String name)
Test to see if a structure has been read in and hence availablestatic Map<String,String>
loadAliasMap(long version)
void
loadAuxFieldInfo(InputStream stream)
static String
simplifyType(String type)
-
-
-
Field Detail
-
VERSION
public static final int VERSION
- See Also:
- Constant Field Values
-
J9_STRUCTURES_EYECATCHER
public static final int J9_STRUCTURES_EYECATCHER
- See Also:
- Constant Field Values
-
STRUCTURE_CONSTRUCTOR_SIGNATURE
public static final Class<?>[] STRUCTURE_CONSTRUCTOR_SIGNATURE
-
BIT_FIELD_FORMAT_LITTLE_ENDIAN
public static final byte BIT_FIELD_FORMAT_LITTLE_ENDIAN
- See Also:
- Constant Field Values
-
BIT_FIELD_FORMAT_BIG_ENDIAN
public static final byte BIT_FIELD_FORMAT_BIG_ENDIAN
- See Also:
- Constant Field Values
-
BIT_FIELD_CELL_SIZE
public static final int BIT_FIELD_CELL_SIZE
- See Also:
- Constant Field Values
-
DDR_VERSIONED_PACKAGE_PREFIX
public static final String DDR_VERSIONED_PACKAGE_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StructureReader
public StructureReader(ImageInputStream in) throws IOException
Initialize this reader from the supplied data. The ImageInputStream must be validated and already be positioned to point to the first byte of the DDR Structure Data. The ByteOrder of the ImageInputStream will be adjusted to match the file being read. (The DDR Structure data is written in the ByteOrder of the platform that created the core file.)- Throws:
IOException
-
StructureReader
public StructureReader(InputStream in) throws IOException
Read a stream in the J9DDRStructStore superset format.- Throws:
IOException
-
-
Method Detail
-
getHeader
public StructureHeader getHeader()
-
getBasePackage
public String getBasePackage()
-
getPackageVersion
public long getPackageVersion()
Get the package version number, derived from fields of DDRAlgorithmVersions in the blob.- Returns:
- the package version number
-
getPackageName
public String getPackageName(StructureReader.PackageNameType type)
Get the package name that should be used including the version information- Parameters:
type
-- Returns:
-
addCompatibilityConstants
public void addCompatibilityConstants(InputStream inputStream) throws IOException
- Throws:
IOException
-
loadAliasMap
public static Map<String,String> loadAliasMap(long version) throws IOException
- Throws:
IOException
-
loadAuxFieldInfo
public void loadAuxFieldInfo(InputStream stream) throws IOException
- Throws:
IOException
-
getStructureNames
public Set<String> getStructureNames()
Get a list of the structures defined by this reader- Returns:
- Set interface for the structure names
-
hasStructure
public boolean hasStructure(String name)
Test to see if a structure has been read in and hence available- Parameters:
name
- name of the structure to look for- Returns:
- true if the structure exists, false if not
-
getStructureSizeOf
public int getStructureSizeOf(String structureName)
-
getStructures
public Collection<StructureReader.StructureDescriptor> getStructures()
-
getFields
public List<StructureReader.FieldDescriptor> getFields(String structureName)
Get a map of the fields for a particular structure and their offsets.- Parameters:
structureName
- name of the structure- Returns:
- map of the fields as FieldName, Offset pair
-
getConstants
public List<StructureReader.ConstantDescriptor> getConstants(String structureName)
-
addStructures
public void addStructures(ImageInputStream ddrStream) throws IOException
Add to the existing set of structures already contained in this reader. Note that this will replace any definitions already contained within the reader.- Parameters:
ddrStream
- stream to add the structures from- Throws:
IOException
-
getStructureClassBytes
public byte[] getStructureClassBytes(String binaryName) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
getPointerClassBytes
public byte[] getPointerClassBytes(String binaryName) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
getConstantValue
public long getConstantValue(String structureName, String constantName, long defaultValue)
-
getBuildFlagValue
public boolean getBuildFlagValue(String structureName, String constantName, boolean defaultValue)
-
getSizeOfBool
public byte getSizeOfBool()
-
getSizeOfUDATA
public byte getSizeOfUDATA()
-
getBitFieldFormat
public byte getBitFieldFormat()
-
-