VOTableUtil
Class Resource

java.lang.Object
  |
  +--VOTableUtil.Resource
All Implemented Interfaces:
java.io.Serializable, com.tbf.xml.Validateable, com.tbf.xml.XmlObject

public class Resource
extends java.lang.Object
implements com.tbf.xml.XmlObject, com.tbf.xml.Validateable, java.io.Serializable

Resource class.

See Also:
Serialized Form

Inner Class Summary
static class Resource.Type
          Enumeration types for the Type property.
 
Field Summary
protected  java.util.Vector _Coosys
           
protected static com.tbf.xml.XmlValidator _Coosys_validator_
           
protected  boolean _defaulted_Type_
           
protected  java.lang.String _Description
           
protected  java.util.Vector _doc_declared_namespaces_
          Storage for namespaces declared in the input document.
protected  java.lang.String _Id
           
protected  java.util.Vector _Info
           
protected static com.tbf.xml.XmlValidator _Info_validator_
           
protected  java.util.Vector _Link
           
protected static com.tbf.xml.XmlValidator _Link_validator_
           
protected  java.lang.String _Name
          Declarations for the XML related fields.
protected static com.tbf.xml.XmlNamespaceManager _nsm_
          The default XmlNamespaceManager for this class.
protected  java.util.Vector _Param
           
protected static com.tbf.xml.XmlValidator _Param_validator_
           
protected  java.util.Vector _Resource
           
protected static com.tbf.xml.XmlValidator _Resource_validator_
           
protected  java.util.Vector _Table
           
protected static com.tbf.xml.XmlValidator _Table_validator_
           
protected  java.lang.String _Type
           
protected static com.tbf.xml.XmlValidator _Type_validator_
           
protected  java.util.Vector _unexpected_xml_errors_
          Storage for UNEXPECTED_XML errors.
protected static boolean _validators_created
          This flag is used to used to check whether the validators have been created.
static java.lang.String $COOSYS
          Constant for "COOSYS" node name.
static java.lang.String $DESCRIPTION
          Constant for "DESCRIPTION" node name.
static java.lang.String $ID
          Constant for "ID" node name.
static java.lang.String $INFO
          Constant for "INFO" node name.
static java.lang.String $LINK
          Constant for "LINK" node name.
static java.lang.String $NAME
          Constant for "name" node name.
static java.lang.String $PARAM
          Constant for "PARAM" node name.
static java.lang.String $RESOURCE
          Constant for "RESOURCE" node name.
static java.lang.String $TABLE
          Constant for "TABLE" node name.
static java.lang.String $TYPE
          Constant for "type" node name.
 
Constructor Summary
Resource()
          Default no args constructor.
Resource(com.tbf.xml.XmlElement xml)
          Creates and populates an instance from the provided parse tree.
Resource(com.tbf.xml.XmlElement xml, com.tbf.xml.XmlObject parent)
          Creates and populates an instance from the provided parse tree.
 
Method Summary
 void addCoosy(Coosys obj)
           
 void addInfo(Info obj)
           
 void addLink(Link obj)
           
 void addParam(Param obj)
           
 void addResource(Resource obj)
           
 void addTable(Table obj)
           
protected static void createValidators()
          Create the validators for this class.
 boolean defaultedType()
          Checks whether the Type property value is the default value.
 void deleteDescription()
          Discards Description's value.
 void deleteId()
          Discards Id's value.
 void deleteName()
          Discards Name's value.
 void deleteType()
          Discards Type's value.
 void fromXml(com.tbf.xml.XmlElement xml)
          Deprecated. will be removed in a future release. Use unmarshal(XmlElement).
 java.util.Vector get$DocumentNamespaces()
          Get the Vector holding the namespaces declared in the element that this instance was unmarshalled from.
 com.tbf.xml.XmlNamespaceManager get$NamespaceManager()
          Get the XmlNamespaceManager for this class.
 com.tbf.xml.XmlObject get$Parent()
          Get this object's parent object.
static java.lang.String getClassXmlTagName()
          Gets the XML tag name for this class.
 Coosys getCoosyAt(int index)
           
 int getCoosyCount()
          Get the count of elements in the Coosys property.
 java.util.Vector getCoosys()
          Get the Coosys property.
 java.lang.String getDescription()
          Get the Description property.
 java.lang.String getId()
          Get the Id property.
 java.util.Vector getInfo()
          Get the Info property.
 Info getInfoAt(int index)
           
 int getInfoCount()
          Get the count of elements in the Info property.
 java.util.Vector getLink()
          Get the Link property.
 Link getLinkAt(int index)
           
 int getLinkCount()
          Get the count of elements in the Link property.
 java.lang.String getName()
          Get the Name property.
 java.util.Vector getParam()
          Get the Param property.
 Param getParamAt(int index)
           
 int getParamCount()
          Get the count of elements in the Param property.
 java.util.Vector getResource()
          Get the Resource property.
 Resource getResourceAt(int index)
           
 int getResourceCount()
          Get the count of elements in the Resource property.
 java.util.Vector getTable()
          Get the Table property.
 Table getTableAt(int index)
           
 int getTableCount()
          Get the count of elements in the Table property.
 java.lang.String getType()
          Get the Type property.
 java.util.Vector getValidationErrors()
          Checks each field on the object for validity and returns a Vector holding the validation errors.
 java.util.Vector getValidationErrors(boolean return_on_error)
          Checks each field on the object for validity and returns a Vector holding the validation errors.
 java.util.Vector getValidationErrors(boolean return_on_error, boolean traverse)
          Checks each field on the object for validity and returns a Vector holding the validation errors.
 java.lang.String getXmlTagName()
          Gets the XML tag name for this object.
 boolean hasDescription()
          Checks for whether Description is set or not.
 boolean hasId()
          Checks for whether Id is set or not.
 boolean hasName()
          Checks for whether Name is set or not.
 boolean hasType()
          Checks for whether Type is set or not.
 boolean isValid()
          Checks this object to see if it will produce valid XML.
 void marshal(java.io.OutputStream stream)
          Writes this instance to a stream.
 void marshal(com.tbf.xml.XmlOutputStream out)
          Writes this instance to an XmlOutputStream.
protected  com.tbf.xml.XmlAttributeList marshalAttributes(com.tbf.xml.XmlAttributeList attrs)
          Get the XmlAttributeList for marshalling.
static boolean matches(com.tbf.xml.XmlElement xml, com.tbf.xml.XmlObject parent)
          Checks the XML to see whether it matches the XML contents of this class.
 void removeCoosy(Coosys obj)
           
 void removeCoosyAt(int index)
           
 void removeInfo(Info obj)
           
 void removeInfoAt(int index)
           
 void removeLink(Link obj)
           
 void removeLinkAt(int index)
           
 void removeParam(Param obj)
           
 void removeParamAt(int index)
           
 void removeResource(Resource obj)
           
 void removeResourceAt(int index)
           
 void removeTable(Table obj)
           
 void removeTableAt(int index)
           
 void set$Parent(com.tbf.xml.XmlObject parent)
          Set this object's parent object.
 void setCoosyAt(Coosys obj, int index)
           
 void setCoosys(java.util.Vector newList)
          Set the Coosys property.
 void setDescription(java.lang.String newValue)
          Set the Description property.
 void setId(java.lang.String newValue)
          Set the Id property.
 void setInfo(java.util.Vector newList)
          Set the Info property.
 void setInfoAt(Info obj, int index)
           
 void setLink(java.util.Vector newList)
          Set the Link property.
 void setLinkAt(Link obj, int index)
           
 void setName(java.lang.String newValue)
          Set the Name property.
 void setParam(java.util.Vector newList)
          Set the Param property.
 void setParamAt(Param obj, int index)
           
 void setResource(java.util.Vector newList)
          Set the Resource property.
 void setResourceAt(Resource obj, int index)
           
 void setTable(java.util.Vector newList)
          Set the Table property.
 void setTableAt(Table obj, int index)
           
 void setType(com.tbf.util.EnumType new_value)
           
 void setType(java.lang.String enumValue)
          Set the Type property.
 void toXml(java.io.OutputStream stream)
          Deprecated. This method will be removed in a future release. Use marshal(XmlOutputStream) or marshal(OutputStream).
 void toXml(java.io.OutputStream stream, boolean embed_files)
          Deprecated. This method will be removed in a future release. Use marshal(XmlOutputStream) or marshal(OutputStream).
 void toXml(java.io.OutputStream stream, java.lang.String indent, boolean embed_files)
          Deprecated. This method will be removed in a future release. Use marshal(XmlOutputStream) or marshal(OutputStream).
static Resource unmarshal(java.io.InputStream in)
          This method unmarshals an XML document instance into an instance of this class.
 void unmarshal(com.tbf.xml.XmlElement xml)
          Populates this object with the values from the parsed XML.
protected  void unmarshalAttributes(com.tbf.xml.XmlElement xml)
          Unmarshal any attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

$NAME

public static final java.lang.String $NAME
Constant for "name" node name.

$INFO

public static final java.lang.String $INFO
Constant for "INFO" node name.

$COOSYS

public static final java.lang.String $COOSYS
Constant for "COOSYS" node name.

$DESCRIPTION

public static final java.lang.String $DESCRIPTION
Constant for "DESCRIPTION" node name.

$TABLE

public static final java.lang.String $TABLE
Constant for "TABLE" node name.

$LINK

public static final java.lang.String $LINK
Constant for "LINK" node name.

$ID

public static final java.lang.String $ID
Constant for "ID" node name.

$RESOURCE

public static final java.lang.String $RESOURCE
Constant for "RESOURCE" node name.

$TYPE

public static final java.lang.String $TYPE
Constant for "type" node name.

$PARAM

public static final java.lang.String $PARAM
Constant for "PARAM" node name.

_Name

protected java.lang.String _Name
Declarations for the XML related fields.

_Id

protected java.lang.String _Id

_Type

protected java.lang.String _Type

_defaulted_Type_

protected boolean _defaulted_Type_

_Description

protected java.lang.String _Description

_Info

protected java.util.Vector _Info

_Coosys

protected java.util.Vector _Coosys

_Param

protected java.util.Vector _Param

_Link

protected java.util.Vector _Link

_Table

protected java.util.Vector _Table

_Resource

protected java.util.Vector _Resource

_unexpected_xml_errors_

protected transient java.util.Vector _unexpected_xml_errors_
Storage for UNEXPECTED_XML errors.

_validators_created

protected static transient boolean _validators_created
This flag is used to used to check whether the validators have been created.

_Type_validator_

protected static transient com.tbf.xml.XmlValidator _Type_validator_

_Info_validator_

protected static transient com.tbf.xml.XmlValidator _Info_validator_

_Coosys_validator_

protected static transient com.tbf.xml.XmlValidator _Coosys_validator_

_Param_validator_

protected static transient com.tbf.xml.XmlValidator _Param_validator_

_Link_validator_

protected static transient com.tbf.xml.XmlValidator _Link_validator_

_Table_validator_

protected static transient com.tbf.xml.XmlValidator _Table_validator_

_Resource_validator_

protected static transient com.tbf.xml.XmlValidator _Resource_validator_

_nsm_

protected static com.tbf.xml.XmlNamespaceManager _nsm_
The default XmlNamespaceManager for this class.
Since:
2.5

_doc_declared_namespaces_

protected java.util.Vector _doc_declared_namespaces_
Storage for namespaces declared in the input document.
Since:
2.5
Constructor Detail

Resource

public Resource()
Default no args constructor.

Resource

public Resource(com.tbf.xml.XmlElement xml)
Creates and populates an instance from the provided parse tree.
Parameters:
xml - the parse tree

Resource

public Resource(com.tbf.xml.XmlElement xml,
                com.tbf.xml.XmlObject parent)
Creates and populates an instance from the provided parse tree.
Parameters:
xml - the parse tree
parent - the containibg XmlObject
Method Detail

getName

public java.lang.String getName()
Get the Name property.

setName

public void setName(java.lang.String newValue)
Set the Name property.

hasName

public boolean hasName()
Checks for whether Name is set or not.
Returns:
true if Name is set, false if not

deleteName

public void deleteName()
Discards Name's value.

getId

public java.lang.String getId()
Get the Id property.

setId

public void setId(java.lang.String newValue)
Set the Id property.

hasId

public boolean hasId()
Checks for whether Id is set or not.
Returns:
true if Id is set, false if not

deleteId

public void deleteId()
Discards Id's value.

getType

public java.lang.String getType()
Get the Type property.

setType

public void setType(java.lang.String enumValue)
Set the Type property.

setType

public void setType(com.tbf.util.EnumType new_value)

hasType

public boolean hasType()
Checks for whether Type is set or not.
Returns:
true if Type is set, false if not

deleteType

public void deleteType()
Discards Type's value.

defaultedType

public boolean defaultedType()
Checks whether the Type property value is the default value.
Returns:
true if Type is defaulted, false if not

getDescription

public java.lang.String getDescription()
Get the Description property.

setDescription

public void setDescription(java.lang.String newValue)
Set the Description property.

hasDescription

public boolean hasDescription()
Checks for whether Description is set or not.
Returns:
true if Description is set, false if not

deleteDescription

public void deleteDescription()
Discards Description's value.

getInfo

public java.util.Vector getInfo()
Get the Info property.

getInfoAt

public Info getInfoAt(int index)
               throws java.lang.IndexOutOfBoundsException

getInfoCount

public int getInfoCount()
Get the count of elements in the Info property.

setInfo

public void setInfo(java.util.Vector newList)
Set the Info property.

addInfo

public void addInfo(Info obj)

setInfoAt

public void setInfoAt(Info obj,
                      int index)
               throws java.lang.IndexOutOfBoundsException

removeInfo

public void removeInfo(Info obj)

removeInfoAt

public void removeInfoAt(int index)
                  throws java.lang.IndexOutOfBoundsException

getCoosys

public java.util.Vector getCoosys()
Get the Coosys property.

getCoosyAt

public Coosys getCoosyAt(int index)
                  throws java.lang.IndexOutOfBoundsException

getCoosyCount

public int getCoosyCount()
Get the count of elements in the Coosys property.

setCoosys

public void setCoosys(java.util.Vector newList)
Set the Coosys property.

addCoosy

public void addCoosy(Coosys obj)

setCoosyAt

public void setCoosyAt(Coosys obj,
                       int index)
                throws java.lang.IndexOutOfBoundsException

removeCoosy

public void removeCoosy(Coosys obj)

removeCoosyAt

public void removeCoosyAt(int index)
                   throws java.lang.IndexOutOfBoundsException

getParam

public java.util.Vector getParam()
Get the Param property.

getParamAt

public Param getParamAt(int index)
                 throws java.lang.IndexOutOfBoundsException

getParamCount

public int getParamCount()
Get the count of elements in the Param property.

setParam

public void setParam(java.util.Vector newList)
Set the Param property.

addParam

public void addParam(Param obj)

setParamAt

public void setParamAt(Param obj,
                       int index)
                throws java.lang.IndexOutOfBoundsException

removeParam

public void removeParam(Param obj)

removeParamAt

public void removeParamAt(int index)
                   throws java.lang.IndexOutOfBoundsException

getLink

public java.util.Vector getLink()
Get the Link property.

getLinkAt

public Link getLinkAt(int index)
               throws java.lang.IndexOutOfBoundsException

getLinkCount

public int getLinkCount()
Get the count of elements in the Link property.

setLink

public void setLink(java.util.Vector newList)
Set the Link property.

addLink

public void addLink(Link obj)

setLinkAt

public void setLinkAt(Link obj,
                      int index)
               throws java.lang.IndexOutOfBoundsException

removeLink

public void removeLink(Link obj)

removeLinkAt

public void removeLinkAt(int index)
                  throws java.lang.IndexOutOfBoundsException

getTable

public java.util.Vector getTable()
Get the Table property.

getTableAt

public Table getTableAt(int index)
                 throws java.lang.IndexOutOfBoundsException

getTableCount

public int getTableCount()
Get the count of elements in the Table property.

setTable

public void setTable(java.util.Vector newList)
Set the Table property.

addTable

public void addTable(Table obj)

setTableAt

public void setTableAt(Table obj,
                       int index)
                throws java.lang.IndexOutOfBoundsException

removeTable

public void removeTable(Table obj)

removeTableAt

public void removeTableAt(int index)
                   throws java.lang.IndexOutOfBoundsException

getResource

public java.util.Vector getResource()
Get the Resource property.

getResourceAt

public Resource getResourceAt(int index)
                       throws java.lang.IndexOutOfBoundsException

getResourceCount

public int getResourceCount()
Get the count of elements in the Resource property.

setResource

public void setResource(java.util.Vector newList)
Set the Resource property.

addResource

public void addResource(Resource obj)

setResourceAt

public void setResourceAt(Resource obj,
                          int index)
                   throws java.lang.IndexOutOfBoundsException

removeResource

public void removeResource(Resource obj)

removeResourceAt

public void removeResourceAt(int index)
                      throws java.lang.IndexOutOfBoundsException

getXmlTagName

public java.lang.String getXmlTagName()
Gets the XML tag name for this object.
Specified by:
getXmlTagName in interface com.tbf.xml.XmlObject

getClassXmlTagName

public static java.lang.String getClassXmlTagName()
Gets the XML tag name for this class.

createValidators

protected static void createValidators()
Create the validators for this class.

isValid

public boolean isValid()
Checks this object to see if it will produce valid XML.
Specified by:
isValid in interface com.tbf.xml.XmlObject

getValidationErrors

public java.util.Vector getValidationErrors()
Checks each field on the object for validity and returns a Vector holding the validation errors.
Specified by:
getValidationErrors in interface com.tbf.xml.Validateable

getValidationErrors

public java.util.Vector getValidationErrors(boolean return_on_error)
Checks each field on the object for validity and returns a Vector holding the validation errors.
Specified by:
getValidationErrors in interface com.tbf.xml.Validateable
Returns:
a Vector containing the validation errors

getValidationErrors

public java.util.Vector getValidationErrors(boolean return_on_error,
                                            boolean traverse)
Checks each field on the object for validity and returns a Vector holding the validation errors.
Specified by:
getValidationErrors in interface com.tbf.xml.Validateable
Returns:
a Vector containing the validation errors

matches

public static boolean matches(com.tbf.xml.XmlElement xml,
                              com.tbf.xml.XmlObject parent)
Checks the XML to see whether it matches the XML contents of this class.

unmarshal

public static Resource unmarshal(java.io.InputStream in)
                          throws java.lang.Exception
This method unmarshals an XML document instance into an instance of this class.

fromXml

public void fromXml(com.tbf.xml.XmlElement xml)
Deprecated. will be removed in a future release. Use unmarshal(XmlElement).

Populates this object with the values from the parsed XML.
Specified by:
fromXml in interface com.tbf.xml.XmlObject

unmarshal

public void unmarshal(com.tbf.xml.XmlElement xml)
Populates this object with the values from the parsed XML.
Specified by:
unmarshal in interface com.tbf.xml.XmlObject
Since:
2.5

unmarshalAttributes

protected void unmarshalAttributes(com.tbf.xml.XmlElement xml)
Unmarshal any attributes.
Parameters:
xml - the XmlElement holding the parsed XML
Since:
2.5

toXml

public void toXml(java.io.OutputStream stream)
Deprecated. This method will be removed in a future release. Use marshal(XmlOutputStream) or marshal(OutputStream).

Writes this instance to a stream.
Specified by:
toXml in interface com.tbf.xml.XmlObject
Parameters:
stream - the OutputStream to write the XML object to

toXml

public void toXml(java.io.OutputStream stream,
                  boolean embed_files)
Deprecated. This method will be removed in a future release. Use marshal(XmlOutputStream) or marshal(OutputStream).

Writes this instance to a stream.
Specified by:
toXml in interface com.tbf.xml.XmlObject
Parameters:
stream - the OutputStream to write the XML object to
embed_files - set to true to embed files in the XML

toXml

public void toXml(java.io.OutputStream stream,
                  java.lang.String indent,
                  boolean embed_files)
Deprecated. This method will be removed in a future release. Use marshal(XmlOutputStream) or marshal(OutputStream).

Writes this instance to a stream.
Specified by:
toXml in interface com.tbf.xml.XmlObject
Parameters:
stream - the OutputStream to write the XML object to
embed_files - set to true to embed files in the XML

marshal

public void marshal(java.io.OutputStream stream)
Writes this instance to a stream. If the OutputStream is not an instance of XmlOutputStream then a FormattedOutputStream will be created which wraps the OutputStream.
Specified by:
marshal in interface com.tbf.xml.XmlObject
Parameters:
stream - the OutputStream to write the XML object to
Since:
2.5
See Also:
marshal(XmlOutputStream)

marshal

public void marshal(com.tbf.xml.XmlOutputStream out)
Writes this instance to an XmlOutputStream.
Specified by:
marshal in interface com.tbf.xml.XmlObject
Parameters:
out - the XmlOutputStream to write the XML object to
Since:
2.5
See Also:
marshal(OutputStream)

marshalAttributes

protected com.tbf.xml.XmlAttributeList marshalAttributes(com.tbf.xml.XmlAttributeList attrs)
Get the XmlAttributeList for marshalling.
Parameters:
attrs - the currently populated XmlAttributeList.
Returns:
a populated XmlAttributeList
Since:
2.5

get$Parent

public com.tbf.xml.XmlObject get$Parent()
Get this object's parent object.
Specified by:
get$Parent in interface com.tbf.xml.XmlObject

set$Parent

public void set$Parent(com.tbf.xml.XmlObject parent)
Set this object's parent object.
Specified by:
set$Parent in interface com.tbf.xml.XmlObject

get$NamespaceManager

public com.tbf.xml.XmlNamespaceManager get$NamespaceManager()
Get the XmlNamespaceManager for this class. This will be null if no namespaces on this class or if namespace support is disabled during code generation.
Specified by:
get$NamespaceManager in interface com.tbf.xml.XmlObject
Since:
2.5

get$DocumentNamespaces

public java.util.Vector get$DocumentNamespaces()
Get the Vector holding the namespaces declared in the element that this instance was unmarshalled from.
Since:
2.5