Class CollectionExtractionUtils
- java.lang.Object
-
- org.eclipse.mat.inspections.collectionextract.CollectionExtractionUtils
-
public class CollectionExtractionUtils extends java.lang.ObjectUtility class providing helpers simplifying the extraction of data from objects in the heap which represent collections- Since:
- 1.5
-
-
Constructor Summary
Constructors Constructor Description CollectionExtractionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AbstractExtractedCollection<?,?>extractCollection(IObject collection)Extracts from the heap the content of objects which represent a collection.static AbstractExtractedCollection<?,?>extractCollection(IObject collection, java.lang.String specificClass, ICollectionExtractor preferredExtractor)Extracts from the heap the content of objects which represent a collection.static ExtractedCollectionextractList(IObject collection)Extracts from the heap the content of objects which represent a collection.static ExtractedMapextractMap(IObject collection)Extracts from the heap the content of objects which represent a Map.static ExtractedMapextractMap(IObject collection, java.lang.String specificClass, IMapExtractor preferredExtractor)Extracts from the heap the content of objects which represent a Map.static ICollectionExtractorfindCollectionExtractor(java.lang.String className)Finds a proper ICollectionExtractor for the object passed as parameterstatic ICollectionExtractorfindCollectionExtractor(IObject collection)Finds a proper ICollectionExtractor for the object passed as parameter
-
-
-
Method Detail
-
findCollectionExtractor
public static ICollectionExtractor findCollectionExtractor(IObject collection) throws SnapshotException
Finds a proper ICollectionExtractor for the object passed as parameter- Parameters:
collection- An IObject representing a collection- Returns:
- ICollectionExtractor an extractor object for the collection
- Throws:
SnapshotException
-
findCollectionExtractor
public static ICollectionExtractor findCollectionExtractor(java.lang.String className) throws SnapshotException
Finds a proper ICollectionExtractor for the object passed as parameter- Parameters:
className- the name of a collection class- Returns:
- ICollectionExtractor an extractor object for the collection
- Throws:
SnapshotException
-
extractCollection
public static AbstractExtractedCollection<?,?> extractCollection(IObject collection) throws SnapshotException
Extracts from the heap the content of objects which represent a collection. The proper extractor is determined internally- Parameters:
collection- an IObject representing a collection for which to extract the contents- Returns:
- AbstractExtractedCollection the extracted contents
- Throws:
SnapshotException
-
extractCollection
public static AbstractExtractedCollection<?,?> extractCollection(IObject collection, java.lang.String specificClass, ICollectionExtractor preferredExtractor) throws SnapshotException
Extracts from the heap the content of objects which represent a collection. For objects of class specifiedClass the preferredExtractor will be used, otherwise the extractor is selected internally- Parameters:
collection- an IObject representing a collection for which to extract the contentsspecificClass- a class name for which the preferred extractor should be usedpreferredExtractor- an extractor object to be used to extract the contents- Returns:
- the extracted contents
- Throws:
SnapshotException
-
extractList
public static ExtractedCollection extractList(IObject collection) throws SnapshotException
Extracts from the heap the content of objects which represent a collection. The proper extractor is determined internally- Parameters:
collection- an IObject representing a List for which to extract the contents- Returns:
- ExtractedCollection the extracted contents
- Throws:
SnapshotException
-
extractMap
public static ExtractedMap extractMap(IObject collection) throws SnapshotException
Extracts from the heap the content of objects which represent a Map. The proper extractor is determined internally- Parameters:
collection- an IObject representing a Map for which to extract the contents- Returns:
- ExtractedMap the extracted contents
- Throws:
SnapshotException
-
extractMap
public static ExtractedMap extractMap(IObject collection, java.lang.String specificClass, IMapExtractor preferredExtractor) throws SnapshotException
Extracts from the heap the content of objects which represent a Map. For objects of class specifiedClass the preferredExtractor will be used, otherwise the extractor is selected internally- Parameters:
collection- an IObject representing a Map for which to extract the contentsspecificClass- a class name for which the preferred extractor should be usedpreferredExtractor- an extractor object to be used to extract the contents- Returns:
- ExtractedMap the extracted contents
- Throws:
SnapshotException
-
-