org.apache.avalon.meta.info.builder
Class XMLServiceCreator

java.lang.Object
  extended byorg.apache.avalon.meta.info.builder.XMLServiceCreator
All Implemented Interfaces:
ServiceCreator
Direct Known Subclasses:
XMLTypeCreator

public class XMLServiceCreator
extends Object
implements ServiceCreator

Utility class the handles the internalization of an XML description of a service into a Service instance.

Version:
$Revision: 1.5 $ $Date: 2003/09/09 22:00:43 $
Author:
Avalon Development Team

Constructor Summary
XMLServiceCreator()
           
 
Method Summary
 Properties buildAttributes(Configuration config)
          Build up a list of attributes from specific config tree.
protected  EntryDescriptor[] buildEntries(Configuration[] entrySet)
          A utility method to build an array of EntryDescriptor objects from specified configuration.
protected  EntryDescriptor buildEntry(Configuration config)
          Create a EntryDescriptor from configuration.
protected  Version buildVersion(String version)
          A utility method to parse a Version object from specified string.
 Service createService(String key, InputStream input)
          Create a Service from stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLServiceCreator

public XMLServiceCreator()
Method Detail

createService

public Service createService(String key,
                             InputStream input)
                      throws Exception
Create a Service from stream

Specified by:
createService in interface ServiceCreator
Parameters:
key - the name of the service type
input - the input stream that the resource is loaded from
Returns:
the created Service
Throws:
Exception - if an error occurs

buildAttributes

public Properties buildAttributes(Configuration config)
                           throws BuildException
Build up a list of attributes from specific config tree.

Parameters:
config - the attributes config
Returns:
the Properties object representing attributes
Throws:
ConfigurationException - if an error occurs
BuildException

buildEntries

protected EntryDescriptor[] buildEntries(Configuration[] entrySet)
                                  throws BuildException
A utility method to build an array of EntryDescriptor objects from specified configuration.

Parameters:
entrySet - the set of entrys to build
Returns:
the created EntryDescriptors
Throws:
ConfigurationException - if an error occurs
BuildException

buildEntry

protected EntryDescriptor buildEntry(Configuration config)
                              throws BuildException
Create a EntryDescriptor from configuration.

Parameters:
config - the configuration
Returns:
the created EntryDescriptor
Throws:
ConfigurationException - if an error occurs
BuildException

buildVersion

protected Version buildVersion(String version)
                        throws BuildException
A utility method to parse a Version object from specified string.

Parameters:
version - the version string
Returns:
the created Version object
Throws:
BuildException


Copyright © Apache Software Foundation. All Rights Reserved.