| org.griphyn.vdl.classes.VDL org.griphyn.vdl.classes.Definitions
Definitions | public class Definitions extends VDL implements Serializable(Code) | | This class implements the container to carry any number of
Transformation and Derivation instances.
In addition, it captures some attributes from the root element of
the XML document.
author: Jens-S. Vöckler author: Yong Zhao version: $Revision: 50 $ See Also: Definition See Also: Transformation See Also: Derivation |
SCHEMA_LOCATION | final public static String SCHEMA_LOCATION(Code) | | The "not-so-official" location URL of the VDLx schema definition.
|
SCHEMA_NAMESPACE | final public static String SCHEMA_NAMESPACE(Code) | | The "official" namespace URI of the VDLx schema.
|
Definitions | public Definitions()(Code) | | ctor. It is strongly suggested that you set the namespace and
version of the object before adding any other
Definition objects.
|
Definitions | public Definitions(String vdlns)(Code) | | ctor: Create a new container, using the given namespace. It is
highly recommended that you set the version number before you add
any
Definition instance.
Parameters: vdlns - is the namespace to use for elements w/o namespace. |
Definitions | public Definitions(String vdlns, String version)(Code) | | ctor: Create a new container, using a namespace and version.
Parameters: vdlns - is the namespace to propagate to children w/o namespace. Parameters: version - is a version of the XML document used to transportthe data. |
addDefinition | public void addDefinition(int index, Definition d) throws IndexOutOfBoundsException(Code) | | Accessor: Inserts a
Definition at a particular place. The
namespace and version information will be, in case they are
missing, updated from the definitions namespace and version
respectively.
Each component in this vector with an index greater or equal to the
specified index is shifted upward to have an index one greater than
the value it had previously.
Parameters: index - is the position to insert a Definition Parameters: d - is the Transformation or Derivationto append to the internal container. throws: IndexOutOfBoundsException - if the definition does not fit intothe container. |
getDefinitionOfAKind | public java.util.List getDefinitionOfAKind(int type)(Code) | | Obtains a vector of all definition instances that share the same
instance type. Please note that the definitions below may change
after the vector is obtained.
a vector with all Transformation or Derivationobjects. The vector may have zero size, if no such instances exist. |
getVersion | public String getVersion()(Code) | | Accessor: Obtains the document version number.
the version number from the document header, or null,if unset. Since the version number is a required attribute,it should never return null, only an empty string. |
positionOfDefinition | public int positionOfDefinition(Definition d)(Code) | | Accessor: Search the database for the existence of a Definition with
the same primary keys and type as the parameter.
Parameters: d - is the Definition to search for the position of the selfsame Definition, or -1 if not found. |
removeAllDefinition | public void removeAllDefinition()(Code) | | Accessor: Removes all definitions we know about.
See Also: Definition |
removeDefinition | public Definition removeDefinition(int index)(Code) | | Accessor: Removes a definition. Each component in this vector with
an index greater or equal to the specified index is shifted
downward to have an index one smaller than the value it had
previously. The size of this vector is decreased by 1.
Parameters: index - is the position to remove the argument fragment from. the removed Definition. exception: ArrayIndexOutOfBoundsException - if the index was invalid. See Also: Definition |
removeDefinition | public boolean removeDefinition(Definition d)(Code) | | Accessor: Removes a definition named by its reference. Removes the
first occurrence of the specified element in this Vector.
Parameters: d - is a definition instance that originated from this list. true, if the first occurance of the element was deleted,false, if there was nothing found to be removed. See Also: Definition |
setDefinition | public Definition setDefinition(int index, Definition d) throws IndexOutOfBoundsException(Code) | | Accessor: Sets the component at the specified index of this vector
to be the specified object. The previous component at that position
is discarded. The index must be a value greater than or equal to 0
and less than the current size of the vector.
Parameters: index - is the postion at which to replace a Definition. Parameters: d - is either a Transformation or Derivation to use for replacement. throws: IndexOutOfBoundsException - if the index was invalid. |
setVdlns | public void setVdlns(String vdlns)(Code) | | Accessor: Sets the document default namespace.
Parameters: vdlns - is the new namespace to use. Note that the change willnot be propagated to contained elememts. See Also: Definitions.getVdlns() |
setVersion | public void setVersion(String version)(Code) | | Accessor: Replaces the version number of the document.
Parameters: version - is the new version number. See Also: Definitions.getVersion() |
toString | public void toString(Writer stream) throws IOException(Code) | | Dumps the content of the given element into a string. This function
traverses all sibling classes as necessary and converts the
data into textual output.
Parameters: stream - is a stream opened and ready for writing. This can alsobe a string stream for efficient output. exception: IOException - if something fishy happens to the stream. |
toXML | public void toXML(Writer stream, String indent, String namespace) throws IOException(Code) | | Dump the state of the current element as XML output. This function
traverses all sibling classes as necessary, and converts the data
into pretty-printed XML output. The stream interface should be able
to handle large output efficiently, if you use a buffered writer.
Parameters: stream - is a stream opened and ready for writing. This can alsobe a string stream for efficient output. Parameters: indent - is a String of spaces used for prettyprinting. The initial amount of spaces should be an empty string.The parameter is used internally for the recursive traversal. Parameters: namespace - is the XML schema namespace prefix. If neitherempty nor null, each element will be prefixed with this prefix,and the root element will map the XML namespace. exception: IOException - if something fishy happens to the stream. |
writeXMLHeader | public void writeXMLHeader(Writer stream, String indent, String namespace) throws IOException(Code) | | Writes the header of the XML output. The output contains the special
strings to start an XML document, some comments, and the root element.
The latter points to the XML schema via XML Instances.
Parameters: stream - is a stream opened and ready for writing. This can alsobe a string stream for efficient output. Parameters: indent - is a String of spaces used for prettyprinting. The initial amount of spaces should be an empty string.The parameter is used internally for the recursive traversal. Parameters: namespace - is the XML schema namespace prefix. If neitherempty nor null, each element will be prefixed with this prefix,and the root element will map the XML namespace. exception: IOException - if something fishy happens to the stream. |
|
|