Class CollectionExtractionUtils
java.lang.Object
org.eclipse.mat.inspections.collectionextract.CollectionExtractionUtils
Utility class providing helpers simplifying the extraction of data from
objects in the heap which represent collections
- Since:
- 1.5
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractExtractedCollection<?,
?> extractCollection
(IObject collection) Extracts from the heap the content of objects which represent a collection.static AbstractExtractedCollection<?,
?> extractCollection
(IObject collection, String specificClass, ICollectionExtractor preferredExtractor) Extracts from the heap the content of objects which represent a collection.static ExtractedCollection
extractList
(IObject collection) Extracts from the heap the content of objects which represent a collection.static ExtractedMap
extractMap
(IObject collection) Extracts from the heap the content of objects which represent a Map.static ExtractedMap
extractMap
(IObject collection, String specificClass, IMapExtractor preferredExtractor) Extracts from the heap the content of objects which represent a Map.static ICollectionExtractor
findCollectionExtractor
(String className) Finds a proper ICollectionExtractor for the object passed as parameterstatic ICollectionExtractor
findCollectionExtractor
(IObject collection) Finds a proper ICollectionExtractor for the object passed as parameter
-
Constructor Details
-
CollectionExtractionUtils
public CollectionExtractionUtils()
-
-
Method Details
-
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(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, 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
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
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, 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
-