IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.ras.type.descriptor
Interface IArtifactDescriptorManager


public interface IArtifactDescriptorManager

The IArtifactDescriptorManager interface manages all the IArtifactDescriptor objects used in RAS. It provides a mechanism to allow additional user defined descriptors to added and used by RAS. It provides the support for loading and persisting the descriptors. This interface is not intended to be implemented by clients.


Method Summary
 void add(IArtifactDescriptor theDescriptor)
          Adds an artifact descriptor to the manager.
 IArtifactDescriptor get(String theDescriptorID)
          Retrieves an artifact descriptor with the corresponding ID from the manager or null if it is not contained in the manager.
 IArtifactDescriptor[] getAllDescriptors()
          Retrieves an array of all artifact descriptors that are being managed.
 ArtifactResourceTypeEnum getResourceType(String theDescriptorType)
          Retrieves a member of the ArtifactResourceTypeEnum enumeration corresponding to the type of a descriptor or null if it is not contained in the manager.
 org.eclipse.core.runtime.IStatus load()
          Loads the persisted artifact descriptors and initializes the artifact manager to a state where it can manage them.
 void remove(String theDescriptorID)
          Removes an artifact descriptor with the corresponding ID from the manager.
 org.eclipse.core.runtime.IStatus restoreDefaults()
          Restores the manager to a state where it contains only the default artifact descriptors that are shipped with the IArtifactDescriptorManager.
 org.eclipse.core.runtime.IStatus save()
          Persists the artifact descriptors being managed to an XML document that will be used instead of the default artifact descriptors that are shipped with the plugin.
 

Method Detail

getAllDescriptors

public IArtifactDescriptor[] getAllDescriptors()
Retrieves an array of all artifact descriptors that are being managed.

Returns:
an array of IArtifactDescriptor interfaces.

add

public void add(IArtifactDescriptor theDescriptor)
         throws IllegalArgumentException,
                NonEditableArtifactDescriptorException
Adds an artifact descriptor to the manager. If it already exists in the manger than the existing atrifact descriptor is replaced with the one being added. If the existing artifact descriptor is not editable then an exception is thrown.

Parameters:
theDescriptor - to add to the manager.
Throws:
IllegalArgumentException - if theDescriptor is null.
NonEditableArtifactDescriptorException - if an attempt is made to replace an existing artifact descriptor that is not editable.

get

public IArtifactDescriptor get(String theDescriptorID)
                        throws IllegalArgumentException
Retrieves an artifact descriptor with the corresponding ID from the manager or null if it is not contained in the manager.

Parameters:
theDescriptorID - of the artifact descriptor to retrieve from the manager.
Returns:
the artifact descriptor matching the ID or null if it doesn't exist.
Throws:
IllegalArgumentException - if theDescriptorID is null.

getResourceType

public ArtifactResourceTypeEnum getResourceType(String theDescriptorType)
                                         throws IllegalArgumentException
Retrieves a member of the ArtifactResourceTypeEnum enumeration corresponding to the type of a descriptor or null if it is not contained in the manager.

Parameters:
theDescriptorType - the artifact descriptor type to retrieve from the manager.
Returns:
the enum matching the type or null if it doesn't exist.
Throws:
IllegalArgumentException - if theDescriptorID is null.

remove

public void remove(String theDescriptorID)
            throws IllegalArgumentException,
                   NonEditableArtifactDescriptorException
Removes an artifact descriptor with the corresponding ID from the manager.

Parameters:
theDescriptorID - of the artifact descriptor to remove from the manager.
Throws:
IllegalArgumentException - if theDescriptorID is null.
NonEditableArtifactDescriptorException - if an attempt is made to remove an existing artifact descriptor that is not editable.

restoreDefaults

public org.eclipse.core.runtime.IStatus restoreDefaults()
Restores the manager to a state where it contains only the default artifact descriptors that are shipped with the IArtifactDescriptorManager.

Returns:
an IStatus indicating if the IArtifactDescriptorManager was restored to a default state.

save

public org.eclipse.core.runtime.IStatus save()
Persists the artifact descriptors being managed to an XML document that will be used instead of the default artifact descriptors that are shipped with the plugin.

Returns:
an IStatus indicating if the artifact descriptors were successfully saved

load

public org.eclipse.core.runtime.IStatus load()
Loads the persisted artifact descriptors and initializes the artifact manager to a state where it can manage them. Any artifact descriptors that are currently being managed and have not been persisted will be lost. The IArtifactDescriptorManager will automatically be loaded once upon creation.

Returns:
an IStatus indicating if the artifact descriptors were successfully loaded

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.