Package ghidra.program.database
Class DataTypeArchiveContentHandler
- java.lang.Object
- 
- ghidra.framework.data.DBContentHandler
- 
- ghidra.program.database.DataTypeArchiveContentHandler
 
 
- 
- All Implemented Interfaces:
- ContentHandler,- ExtensionPoint
 
 public class DataTypeArchiveContentHandler extends DBContentHandler DataTypeArchiveContentHandlerconverts between DataTypeArchive instantiations and FolderItem storage. This class also produces the appropriate Icon for DataTypeArchive files.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface ghidra.util.classfinder.ExtensionPointExtensionPoint.Exclude, ExtensionPoint.Util
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static java.lang.StringDATA_TYPE_ARCHIVE_CONTENT_TYPE- 
Fields inherited from interface ghidra.framework.data.ContentHandlerMISSING_CONTENT, UNKNOWN_CONTENT
 
- 
 - 
Constructor SummaryConstructors Constructor Description DataTypeArchiveContentHandler()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description longcreateFile(FileSystem fs, FileSystem userfs, java.lang.String path, java.lang.String name, DomainObject obj, TaskMonitor monitor)Creates a new folder item within a specified file-system.ChangeSetgetChangeSet(FolderItem item, int fromVer, int toVer)Returns the object change data which includes changes made to the specified olderVersion through to the specified newerVersion.java.lang.StringgetContentType()Returns list of unique content-types supported.java.lang.StringgetContentTypeDisplayString()A string that is meant to be presented to the user.java.lang.StringgetDefaultToolName()Returns the name of the default tool that should be used to open this content typeDomainObjectAdaptergetDomainObject(FolderItem item, FileSystem userfs, long checkoutId, boolean okToUpgrade, boolean recover, java.lang.Object consumer, TaskMonitor monitor)Open a folder item for update.java.lang.Class<? extends DomainObject>getDomainObjectClass()Returns domain object implementation class supported.javax.swing.IcongetIcon()Returns the Icon associated with this handlers content type.DomainObjectAdaptergetImmutableObject(FolderItem item, java.lang.Object consumer, int version, int minChangeVersion, TaskMonitor monitor)Open a folder item for immutable use.DomainObjectMergeManagergetMergeManager(DomainObject resultsObj, DomainObject sourceObj, DomainObject originalObj, DomainObject latestObj)Get an instance of a suitable merge manager to be used during the merge of a Versioned object which has been modified by another user since it was last merged or checked-out.DomainObjectAdaptergetReadOnlyObject(FolderItem item, int version, boolean okToUpgrade, java.lang.Object consumer, TaskMonitor monitor)Open a folder item for read-only use.booleanisPrivateContentType()Returns true if the content type is always private (i.e., can not be added to the versioned filesystem).- 
Methods inherited from class ghidra.framework.data.DBContentHandlercreateFile, openAssociatedUserFile, removeUserDataFile, saveUserDataFile
 
- 
 
- 
- 
- 
Field Detail- 
DATA_TYPE_ARCHIVE_CONTENT_TYPEpublic static final java.lang.String DATA_TYPE_ARCHIVE_CONTENT_TYPE - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
createFilepublic long createFile(FileSystem fs, FileSystem userfs, java.lang.String path, java.lang.String name, DomainObject obj, TaskMonitor monitor) throws java.io.IOException, InvalidNameException, CancelledException Description copied from interface:ContentHandlerCreates a new folder item within a specified file-system. If fs is versioned, the resulting item is marked as checked-out within the versioned file-system. The specified domainObj will become associated with the newly created database.- Parameters:
- fs- the file system in which to create the folder item
- userfs- file system which contains associated user data
- path- the path of the folder item
- name- the name of the new folder item
- obj- the domain object to store in the newly created folder item
- monitor- the monitor that allows the user to cancel
- Returns:
- checkout ID for new item
- Throws:
- java.io.IOException- if an i/o error occurs
- InvalidNameException- if the specified name contains invalid characters
- CancelledException- if the user cancels
 
 - 
getImmutableObjectpublic DomainObjectAdapter getImmutableObject(FolderItem item, java.lang.Object consumer, int version, int minChangeVersion, TaskMonitor monitor) throws java.io.IOException, VersionException, CancelledException Description copied from interface:ContentHandlerOpen a folder item for immutable use. If any changes are attempted on the returned object, an IllegalStateException state exception may be thrown.- Parameters:
- item- stored folder item
- consumer- consumer of the returned object
- version- version of the stored folder item to be opened. DomainFile.DEFAULT_VERSION (-1) should be specified when not opening a specific file version.
- minChangeVersion- the minimum version which should be included in the change set for the returned object. A value of -1 indicates the default change set.
- monitor- the monitor that allows the user to cancel
- Returns:
- immutable domain object
- Throws:
- java.io.IOException- if a folder item access error occurs
- VersionException- if unable to handle file content due to version difference which could not be handled.
- CancelledException- if operation is cancelled by user
 
 - 
getReadOnlyObjectpublic DomainObjectAdapter getReadOnlyObject(FolderItem item, int version, boolean okToUpgrade, java.lang.Object consumer, TaskMonitor monitor) throws java.io.IOException, VersionException, CancelledException Description copied from interface:ContentHandlerOpen a folder item for read-only use. While changes are permitted on the returned object, the original folder item may not be overwritten / updated.- Parameters:
- item- stored folder item
- version- version of the stored folder item to be opened. DomainFile.DEFAULT_VERSION should be specified when not opening a specific file version.
- okToUpgrade- if true a version upgrade to the content will be done if necessary.
- consumer- consumer of the returned object
- monitor- the monitor that allows the user to cancel
- Returns:
- read-only domain object
- Throws:
- java.io.IOException- if a folder item access error occurs
- VersionException- if unable to handle file content due to version difference which could not be handled.
- CancelledException- if operation is cancelled by user
 
 - 
getDomainObjectpublic DomainObjectAdapter getDomainObject(FolderItem item, FileSystem userfs, long checkoutId, boolean okToUpgrade, boolean recover, java.lang.Object consumer, TaskMonitor monitor) throws java.io.IOException, VersionException, CancelledException Description copied from interface:ContentHandlerOpen a folder item for update. Changes made to the returned object may be saved to the original folder item.- Parameters:
- item- stored folder item
- userfs- file system which contains associated user data
- checkoutId- an appropriate checout ID required to update the specified folder item.
- okToUpgrade- if true a version upgrade to the content will be done if necessary.
- recover- if true an attempt to recover any unsaved changes resulting from a crash will be attempted.
- consumer- consumer of the returned object
- monitor- cancelable task monitor
- Returns:
- updateable domain object
- Throws:
- java.io.IOException- if a folder item access error occurs
- VersionException- if unable to handle file content due to version difference which could not be handled.
- CancelledException- if operation is cancelled by user
 
 - 
getChangeSetpublic ChangeSet getChangeSet(FolderItem item, int fromVer, int toVer) throws VersionException, java.io.IOException Description copied from interface:ContentHandlerReturns the object change data which includes changes made to the specified olderVersion through to the specified newerVersion.- Parameters:
- item- versioned folder item
- fromVer- the older version number
- toVer- the newer version number
- Returns:
- the set of changes that were made
- Throws:
- VersionException- if a database version change prevents reading of data.
- java.io.IOException- if a folder item access error occurs
 
 - 
getDomainObjectClasspublic java.lang.Class<? extends DomainObject> getDomainObjectClass() Description copied from interface:ContentHandlerReturns domain object implementation class supported.
 - 
getContentTypepublic java.lang.String getContentType() Description copied from interface:ContentHandlerReturns list of unique content-types supported. A minimum of one content-type will be returned. If more than one is returned, these are considered equivalent aliases.
 - 
getContentTypeDisplayStringpublic java.lang.String getContentTypeDisplayString() Description copied from interface:ContentHandlerA string that is meant to be presented to the user.
 - 
getDefaultToolNamepublic java.lang.String getDefaultToolName() Description copied from interface:ContentHandlerReturns the name of the default tool that should be used to open this content type
 - 
getIconpublic javax.swing.Icon getIcon() Description copied from interface:ContentHandlerReturns the Icon associated with this handlers content type.
 - 
isPrivateContentTypepublic boolean isPrivateContentType() Description copied from interface:ContentHandlerReturns true if the content type is always private (i.e., can not be added to the versioned filesystem).
 - 
getMergeManagerpublic DomainObjectMergeManager getMergeManager(DomainObject resultsObj, DomainObject sourceObj, DomainObject originalObj, DomainObject latestObj) Description copied from interface:ContentHandlerGet an instance of a suitable merge manager to be used during the merge of a Versioned object which has been modified by another user since it was last merged or checked-out.- Parameters:
- resultsObj- object to which merge results should be written
- sourceObj- object which contains user's changes to be merged
- originalObj- object which corresponds to checked-out version state
- latestObj- object which corresponds to latest version with which the sourceObj must be merged.
- Returns:
- merge manager
 
 
- 
 
-