ControlDocumentFactory Class
- public class ControlDocumentFactory
extends DefaultDocumentHandler
implements IRelatedDocumentHandler
Creates Document handlers for webservice documents.
-
Hierarchy
-
Object
DefaultDocumentHandler
ControlDocumentFactory
-
All Implemented Interfaces
-
IDocumentHandler
, IRelatedDocumentHandler
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EXTENSION
public static final String
EXTENSION
EXTENSION_IMPL
public static final String
EXTENSION_IMPL
EXTENSION_OLD
public static final String
EXTENSION_OLD
ControlDocumentFactory
public ControlDocumentFactory()
- Creates a control document factory with the default extension.
ControlDocumentFactory
public ControlDocumentFactory(boolean useCtrl)
- Creates a control document factory that uses either the old or new file extension.
createDocumentObject(URI) Method
public IDocument
createDocumentObject(URI
uriFile)
Create a document object for the given file.
-
Overrides
-
DefaultDocumentHandler.createDocumentObject(URI)
Parameters
-
uriFile
- Name of the existing file to create the IDocument interface for
Returns
- An object implementing the IDocument interface that represents the contents of the
given file
getBaseName(String) Method
public String
getBaseName(String
sFile)
Description copied from IDocumentHandler.getBaseName(String)
Derives the base name for the given file, stripping away all extension and name suffix
information. Generally, it simply removes the extension, but some handlers may also
add a pre-extension suffix to a file. This method strips all of that out to determine
the original name.
-
Overrides
-
DefaultDocumentHandler.getBaseName(String)
Parameters
-
sFile
- The filename that should be examined to find the original name. This should
not contain any path information (i.e. directory or separators)
Returns
- The base name that the given name was derived from.
getDefaultNameSuffix() Method
public String
getDefaultNameSuffix()
Add this to the name of control files.
getParentDocument(URI) Method
public URI
getParentDocument(URI
uriFile)
Description copied from IRelatedDocumentHandler.getParentDocument(URI)
Obtain the parent document for the given file. If the isAutogenerated method returns true
for a URI, this method should return the document from which the first was generated.
Parameters
-
uriFile
- URI of autogenerated file
Returns
- URI of the file used to generate uriFile, or null if uriFile is not autogenerated
or it's parent cannot be determined.
invalidNameCheck(String) Method
public String
invalidNameCheck(String
sFile)
Description copied from IDocumentHandler.invalidNameCheck(String)
Checks the given filename to see if it is a valid name for this handler. This check
may include verification of the extension and any other requirements on the filename.
For example, the java handler can require that the filename be a valid java identifier.
-
Overrides
-
DefaultDocumentHandler.invalidNameCheck(String)
Parameters
-
sFile
- The filename that should be examined for validity. This should
not contain any path information (i.e. directory or separators).
Returns
- String value indicating the error message that should be shown to the user or null
if the name is valid.
isAutogenerated(URI) Method
public boolean isAutogenerated(URI
uriFile)
Description copied from IRelatedDocumentHandler.isAutogenerated(URI)
This method allows the handler to determine if the specified file is autogenerated. This is
the equivalent of instantiating the document for the file and using the IRelatedDocument
interface to make the same method call. This method does not require instantiating the document
however and is therefore lighter weight.
Parameters
-
uriFile
- File to check for autogeneration
Returns
- true if the given uri is a file that was completely generated from the contents
of another file.
suggestValidName(String) Method
public String
suggestValidName(String
sFile)
Description copied from IDocumentHandler.suggestValidName(String)
Examine the given filename and derive a valid filename from it. This method differs
from IDocumentHandler.invalidNameCheck(String)
in that rather than returning an error, it will attempt
to address any invalid characters in the name and correct them. An example is an
implementation that replaces spaces with '_' in a handler that does not allow spaces.
-
Overrides
-
DefaultDocumentHandler.suggestValidName(String)
Parameters
-
sFile
- The filename that should be examined for validity. This should
not contain any path information (i.e. directory or separators).
Returns
- A valid filename for which invalidNameCheck will return null, indicating a valid name.