org.sape.carbon.services.config.jar
Class AbstractJarConfigurationDocumentFactory

java.lang.Object
  |
  +--org.sape.carbon.services.config.jar.AbstractJarConfigurationDocumentFactory
All Implemented Interfaces:
NodeFactory
Direct Known Subclasses:
JarConfigurationDocumentFactory, JarLinkNodeConfigurationDocumentFactory

public abstract class AbstractJarConfigurationDocumentFactory
extends Object
implements NodeFactory

Base class for factories that construct JarConfigurationDocuments. Copyright 2002 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.3 $($Author: dvoet $ / $Date: 2003/05/05 21:21:09 $)
Author:
Douglas Voet, March 2002

Field Summary
private static ConfigurationFormatService FORMAT_SERVICE
          holds a reference to the format service.
 
Constructor Summary
AbstractJarConfigurationDocumentFactory()
           
 
Method Summary
protected  ConfigurationFormatService getConfigurationFormatService()
          Method that determines which ConfigurationFormatService will be used within the ConfigurationDocuments of the file package.
protected abstract  String getFileExtension()
          Gets the file extension for the node being created by the factory.
 Node getInstance(Node parent, String name)
          Creates FileConfigurationDocument objects only as children of FileFolders.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORMAT_SERVICE

private static final ConfigurationFormatService FORMAT_SERVICE
holds a reference to the format service.

Constructor Detail

AbstractJarConfigurationDocumentFactory

public AbstractJarConfigurationDocumentFactory()
Method Detail

getInstance

public Node getInstance(Node parent,
                        String name)
                 throws NodeCreationException
Creates FileConfigurationDocument objects only as children of FileFolders.

Specified by:
getInstance in interface NodeFactory
Parameters:
parent - the parent of the node
name - the name of the node
Returns:
the newly created node
Throws:
InvalidParameterException - if parent is not assignable from FileFolder
NodeCreationException - indicates an error creating the node
See Also:
NodeFactory.getInstance(org.sape.carbon.core.config.node.Node, java.lang.String)

getFileExtension

protected abstract String getFileExtension()
Gets the file extension for the node being created by the factory. The extension is used to identify the type of node contained within the document (ConfigurationDocument or LinkNode at this time).

Returns:
String the file extension starting with a '.'

getConfigurationFormatService

protected ConfigurationFormatService getConfigurationFormatService()
Method that determines which ConfigurationFormatService will be used within the ConfigurationDocuments of the file package. The default implementation returns a static instance of org.sape.carbon.core.config.format.DefaultConfigurationFormatService. Override this method to change the ConfigurationFormatService used by the FileConfigurationDocument.

Returns:
ConfigurationFormatService


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.