org.openide.loaders
Class UniFileLoader
java.lang.Object
|
+--org.openide.util.SharedClassObject
|
+--org.openide.loaders.DataLoader
|
+--org.openide.loaders.MultiFileLoader
|
+--org.openide.loaders.UniFileLoader
- All Implemented Interfaces:
- Externalizable, Serializable
- public abstract class UniFileLoader
- extends MultiFileLoader
Support class for loader handling one file at a time.
This is used for many file types, e.g. HTML, images, etc.
File extensions recognized by the loader may be set.
- See Also:
- Serialized Form
Methods inherited from class org.openide.loaders.DataLoader |
clearSharedData, defaultActions, defaultDisplayName, findDataObject, getActions, getDisplayName, getLoader, getRepresentationClass, markFile, setActions, setDisplayName |
Methods inherited from class org.openide.util.SharedClassObject |
addNotify, addPropertyChangeListener, equals, finalize, findObject, findObject, firePropertyChange, getLock, getProperty, hashCode, initialize, putProperty, putProperty, removeNotify, removePropertyChangeListener, writeReplace |
PROP_EXTENSIONS
public static final String PROP_EXTENSIONS
- name of property with extensions
UniFileLoader
protected UniFileLoader(Class representationClass)
- Constructor.
- Parameters:
representationClass
- class that is produced by this loader
UniFileLoader
protected UniFileLoader(String representationClassName)
- Constructor.
- Parameters:
representationClassName
- the fully qualified name of the
representation class.- Since:
- 1.10
findPrimaryFile
protected FileObject findPrimaryFile(FileObject fo)
- Get the primary file.
By default, only accepts files, not folders.
- Overrides:
findPrimaryFile
in class MultiFileLoader
- Parameters:
fo
- the file to find the primary file for- Returns:
- the primary file, or
null
if its extension is not recognized
createMultiObject
protected abstract MultiDataObject createMultiObject(FileObject primaryFile)
throws DataObjectExistsException,
IOException
- Description copied from class:
MultiFileLoader
- Creates the right data object for a given primary file.
It is guaranteed that the provided file will actually be the primary file
returned by
MultiFileLoader.findPrimaryFile(org.openide.filesystems.FileObject)
.
- Overrides:
createMultiObject
in class MultiFileLoader
- Following copied from class:
org.openide.loaders.MultiFileLoader
- Parameters:
primaryFile
- the primary file- Returns:
- the data object for this file
- Throws:
DataObjectExistsException
- if the primary file already has a data object
createPrimaryEntry
protected MultiDataObject.Entry createPrimaryEntry(MultiDataObject obj,
FileObject primaryFile)
- Description copied from class:
MultiFileLoader
- Creates the right primary entry for a given primary file.
- Overrides:
createPrimaryEntry
in class MultiFileLoader
- Following copied from class:
org.openide.loaders.MultiFileLoader
- Parameters:
obj
- requesting objectprimaryFile
- primary file recognized by this loader- Returns:
- primary entry for that file
createSecondaryEntry
protected MultiDataObject.Entry createSecondaryEntry(MultiDataObject obj,
FileObject secondaryFile)
- Do not create a seconday entry.
- Overrides:
createSecondaryEntry
in class MultiFileLoader
- Parameters:
obj
- ignoredsecondaryFile
- ignored- Returns:
- never returns
- Throws:
UnsupportedOperationException
- because this loader supports only a primary file object
setExtensions
public void setExtensions(ExtensionList ext)
- Set the extension list for this data loader.
- Parameters:
ext
- new list of extensions
getExtensions
public ExtensionList getExtensions()
- Get the extension list for this data loader.
- Returns:
- list of extensions
writeExternal
public void writeExternal(ObjectOutput oo)
throws IOException
- Writes extensions to the stream.
- Overrides:
writeExternal
in class DataLoader
- Parameters:
oo
- ignored
readExternal
public void readExternal(ObjectInput oi)
throws IOException,
ClassNotFoundException
- Reads nothing from the stream.
- Overrides:
readExternal
in class DataLoader
- Parameters:
oi
- ignored
Built on December 12 2001. | Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.