Copyright @ 2002 SAP. All Rights Reserved.

com.sap.tc.complib
Class ComponentFactory

java.lang.Object
  |
  +--com.sap.tc.complib.ComponentFactory

public class ComponentFactory
extends java.lang.Object

Factory for creating components, public parts, packages and dependencies, and for marshalling/unmarshalling of components and public parts.


Field Summary
static java.lang.String SCHEMA_VERSION
          The schema version number of this API
static java.lang.String SCHEMA_VERSION_1_0_0
          ID vor schema version 1_0_0.
static java.lang.String SCHEMA_VERSION_1_0_1
          ID vor schema version 1_0_1.
static java.lang.String SCHEMA_VERSION_1_0_2
          ID vor schema version 1_0_2.
Schema changes 1.0.1->1.0.2:
<development-component> : added <any> tag at end of sequence to allow compatible enhancements, added <anyAttribute>
<development-component> : added <deprecated> flag
<dependency> : added <any> tag at end of sequence to allow compatible enhancements, added <anyAttribute>
<public-part> : added <any> tag at end of sequence to allow compatible enhancements, added <anyAttribute>
<public-part> : added <deprecated> flag
<entity> : added <any> tag at end of sequence to allow compatible enhancements, added <anyAttribute>
<entity-ref> : added <any> tag at end of sequence to allow compatible enhancements, added <anyAttribute>
<entity-ref> : added <package> and <entity-sub-type> tags
 
Constructor Summary
ComponentFactory()
           
 
Method Summary
static Dependency createDependency()
          Creates a new empty dependency.
static Dependency createDependency(DCReference ref, DevelopmentComponent parent)
          Creates a new dependency instance that points to the given component and adds the dependency to the given DC.
static Dependency createDependency(PPReference ref, DevelopmentComponent parent)
          Creates a new dependency instance that points to the given public part and adds the dependency to the given DC.
static DevelopmentComponent createDevelopmentComponent()
          Creates a new empty development component instance.
static DevelopmentComponent createDevelopmentComponent(java.lang.String name, java.lang.String vendor, ComponentType componentType)
          Creates a new development component with given name, vendor id and component type.
static Entity createEntity()
          Creates a new empty entity instance.
static Entity createEntity(java.lang.String entityName, java.lang.String entityType, PublicPart publicPart)
          Creates a new entity instance with given name and adds that entity to the given public part.
static ImportedEntity createImportedEntity()
          Creates a new empty imported entity instance.
static ImportedEntity createImportedEntity(java.lang.String entityName, java.lang.String entityType, PublicPart publicPart)
          Creates a new imported entity instance with given name and adds that entity to the given public part.
static Property createProperty()
          Creates a new empty property instance.
static Property createProperty(java.lang.String propertyName, DevelopmentComponent parent)
          Creates a new property instance with the given name and adds that property to the given development component.
static Property createProperty(java.lang.String propertyName, java.lang.String namespacePrefix, java.lang.String namespaceURI, DevelopmentComponent parent)
          Creates a new property instance with given name, namespace prefix and URI and adds that property to the given development component
static PublicPart createPublicPart()
          Creates a new empty public part instance.
static PublicPart createPublicPart(java.lang.String publicPartName, DevelopmentComponent parent)
          Creates a new public part instance with given name and adds that public part to the given development component
static SoftwareComponent createSoftwareComponent()
          Creates a new empty software component instance.
static SoftwareComponent createSoftwareComponent(java.lang.String name, java.lang.String vendor)
          Creates a new software component with given name, vendor id and component type.
static java.lang.String[] getSchemaVersions()
          Returns the (sorted) list of schema versions supported by this API.
static DevelopmentComponent initialize(DCInputProvider provider)
          Initializes the referenced development component.
static DevelopmentComponent initialize(DCInputProvider provider, boolean withPPs)
          Initializes the referenced development component and optionall its public parts.
static PublicPart initialize(PPInputProvider provider)
           
static SoftwareComponent initialize(SCInputProvider provider)
          Initializes the referenced software component.
static boolean isSchemaAllowed(java.lang.String schemaVersion)
          Checks whether this library is capable of writing the given schema version
static void serialize(DevelopmentComponent component, DCOutputProvider provider)
          Serializes the given development component.
static void serialize(PublicPart publicPart, PPOutputProvider provider)
           
static void serialize(SoftwareComponent component, SCOutputProvider provider)
          Serializes the given software component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHEMA_VERSION_1_0_0

public static final java.lang.String SCHEMA_VERSION_1_0_0
ID vor schema version 1_0_0. This is the API version of NWDI release 6.30.

SCHEMA_VERSION_1_0_1

public static final java.lang.String SCHEMA_VERSION_1_0_1
ID vor schema version 1_0_1. This is the API version of NWDI release 6.40.
Schema changes 1.0.0->1.0.1:
<development-component> : added <properties> and <folders> tags <entity> : added <fileset> tag

SCHEMA_VERSION_1_0_2

public static final java.lang.String SCHEMA_VERSION_1_0_2
ID vor schema version 1_0_2.
Schema changes 1.0.1->1.0.2:
<development-component> : added <any> tag at end of sequence to allow compatible enhancements, added <anyAttribute>
<development-component> : added <deprecated> flag
<dependency> : added <any> tag at end of sequence to allow compatible enhancements, added <anyAttribute>
<public-part> : added <any> tag at end of sequence to allow compatible enhancements, added <anyAttribute>
<public-part> : added <deprecated> flag
<entity> : added <any> tag at end of sequence to allow compatible enhancements, added <anyAttribute>
<entity-ref> : added <any> tag at end of sequence to allow compatible enhancements, added <anyAttribute>
<entity-ref> : added <package> and <entity-sub-type> tags

SCHEMA_VERSION

public static final java.lang.String SCHEMA_VERSION
The schema version number of this API
Constructor Detail

ComponentFactory

public ComponentFactory()
Method Detail

getSchemaVersions

public static java.lang.String[] getSchemaVersions()
Returns the (sorted) list of schema versions supported by this API.
Returns:
the list of schema versions

isSchemaAllowed

public static boolean isSchemaAllowed(java.lang.String schemaVersion)
Checks whether this library is capable of writing the given schema version
Parameters:
schemaVersion - the schema version to check
Returns:
true, if the library is capable of wrting the given schema version.

createDevelopmentComponent

public static DevelopmentComponent createDevelopmentComponent()
Creates a new empty development component instance.
Returns:
a development component instance.

createDevelopmentComponent

public static DevelopmentComponent createDevelopmentComponent(java.lang.String name,
                                                              java.lang.String vendor,
                                                              ComponentType componentType)
Creates a new development component with given name, vendor id and component type.
Returns:
a development component instance.

createProperty

public static Property createProperty()
Creates a new empty property instance.
Returns:
a property instance.

createProperty

public static Property createProperty(java.lang.String propertyName,
                                      DevelopmentComponent parent)
Creates a new property instance with the given name and adds that property to the given development component. Note, the property is put in the default namespace used by the component description files.
Parameters:
propertyName - the name of the property
parent - the DC to which this property should be assigned.
Returns:
a property instance.

createProperty

public static Property createProperty(java.lang.String propertyName,
                                      java.lang.String namespacePrefix,
                                      java.lang.String namespaceURI,
                                      DevelopmentComponent parent)
Creates a new property instance with given name, namespace prefix and URI and adds that property to the given development component
Parameters:
propertyName - the name of the property
namespacePrefix - the namespace prefix to use when serializing this property
namespaceURI - determines the namespace to which the property belongs, usually in the form of an URL (e.g. "http://sap.com/properties")
parent - the DC to which this property should be assigned.
Returns:
a property instance.

createPublicPart

public static PublicPart createPublicPart()
Creates a new empty public part instance.
Returns:
a public part instance.

createPublicPart

public static PublicPart createPublicPart(java.lang.String publicPartName,
                                          DevelopmentComponent parent)
Creates a new public part instance with given name and adds that public part to the given development component
Parameters:
publicPartName - the DC local name of the public part
parent - the DC to which this public part should be assigned.
Returns:
a public part instance.

createEntity

public static Entity createEntity()
Creates a new empty entity instance.
Returns:
a entity instance.

createEntity

public static Entity createEntity(java.lang.String entityName,
                                  java.lang.String entityType,
                                  PublicPart publicPart)
Creates a new entity instance with given name and adds that entity to the given public part.
Parameters:
name - the entity name
publicPart - the public part to which this entity should be assigned.
Returns:
a entity instance.

createImportedEntity

public static ImportedEntity createImportedEntity()
Creates a new empty imported entity instance.
Returns:
a entity instance.

createImportedEntity

public static ImportedEntity createImportedEntity(java.lang.String entityName,
                                                  java.lang.String entityType,
                                                  PublicPart publicPart)
Creates a new imported entity instance with given name and adds that entity to the given public part.
Parameters:
name - the entity name
publicPart - the public part to which this entity should be assigned.
Returns:
a entity instance.

createDependency

public static Dependency createDependency()
Creates a new empty dependency.
Returns:
a dependency instance.

createDependency

public static Dependency createDependency(DCReference ref,
                                          DevelopmentComponent parent)
Creates a new dependency instance that points to the given component and adds the dependency to the given DC.
Parameters:
parent - the DC to which this dependency should be assigned.
Returns:
a package instance.

createDependency

public static Dependency createDependency(PPReference ref,
                                          DevelopmentComponent parent)
Creates a new dependency instance that points to the given public part and adds the dependency to the given DC.
Parameters:
parent - the DC to which this dependency should be assigned.
Returns:
a package instance.

createSoftwareComponent

public static SoftwareComponent createSoftwareComponent()
Creates a new empty software component instance.
Returns:
a software component instance.

createSoftwareComponent

public static SoftwareComponent createSoftwareComponent(java.lang.String name,
                                                        java.lang.String vendor)
Creates a new software component with given name, vendor id and component type.
Returns:
a software component instance.

serialize

public static void serialize(DevelopmentComponent component,
                             DCOutputProvider provider)
                      throws java.io.IOException,
                             ProviderException
Serializes the given development component.
Parameters:
component - the component to serialize.
provider - the provider that provide OutputStreams for serialization.
Throws:
java.io.IOException - if an i/o error occured.
ProviderException - if the provider was not able to suppy a valid output stream for serialization.

serialize

public static void serialize(PublicPart publicPart,
                             PPOutputProvider provider)
                      throws java.io.IOException,
                             ProviderException

serialize

public static void serialize(SoftwareComponent component,
                             SCOutputProvider provider)
                      throws java.io.IOException,
                             ProviderException
Serializes the given software component.
Parameters:
component - the component to serialize.
provider - the provider that provide OutputStreams for serialization.
Throws:
java.io.IOException - if an i/o error occured.
ProviderException - if the provider was not able to suppy a valid output stream for serialization.

initialize

public static DevelopmentComponent initialize(DCInputProvider provider)
                                       throws java.io.IOException,
                                              XMLException,
                                              ProviderException
Initializes the referenced development component.
Parameters:
component - reference to a component to unmarshal
Returns:
a component instance

initialize

public static DevelopmentComponent initialize(DCInputProvider provider,
                                              boolean withPPs)
                                       throws java.io.IOException,
                                              XMLException,
                                              ProviderException
Initializes the referenced development component and optionall its public parts.
Parameters:
component - reference to a component to unmarshal
Returns:
a component instance

initialize

public static PublicPart initialize(PPInputProvider provider)
                             throws java.io.IOException,
                                    XMLException,
                                    ProviderException

initialize

public static SoftwareComponent initialize(SCInputProvider provider)
                                    throws java.io.IOException,
                                           XMLException,
                                           ProviderException
Initializes the referenced software component.
Parameters:
component - reference to a component to unmarshal
provider - the provider that provides InputStreams for initialization.
Returns:
a software component instance.
Throws:
java.io.IOException - if an i/o error occured.
XMLException - if an exception occured in the parser
ProviderException - if the provider was not able to suppy a valid output stream for serialization.

Copyright @ 2002 SAP. All Rights Reserved.