org.ocd.blx
Class XMLObjectWrapper

java.lang.Object
  |
  +--org.ocd.blx.XMLObjectWrapper

public class XMLObjectWrapper
extends java.lang.Object

Since:
$Date: 2002/06/12 03:58:03 $
Version:
$Revision: 1.4 $
Author:
$Author: drichan $, ocd_dino - ocd_dino@users.sourceforge.net (initial author)

Constructor Summary
XMLObjectWrapper()
          Creates new XMLObjectWrapper
XMLObjectWrapper(org.w3c.dom.Document pBLXDocument, java.net.URL pMainURL)
          Creates new XMLObjectWrapper
XMLObjectWrapper(org.w3c.dom.Node pBLXNode, java.net.URL pMainURL)
          Creates new XMLObjectWrapper
XMLObjectWrapper(java.net.URL pMainURL)
          Creates new XMLObjectWrapper
XMLObjectWrapper(java.net.URL pMainURL, java.lang.String pBLXData)
          Creates new XMLObjectWrapper
 
Method Summary
 org.w3c.dom.Element createBLXElement()
          Create an BLX Element for this XML Object
 java.net.URL getAbsoluteHREF()
          Get the Absolute URL for the HREF attribute If the HREF attribute is not set then this returns null
 org.w3c.dom.Element getBLXElement()
          Get the BLXElement that was used to create this Wrapper Object
 java.lang.String getClassName()
          Get the ClassName for this BLX Object
 java.lang.String getExtensionHREF()
          Get the Extension HREF
 java.lang.String getExtensionName()
          Get the Name of the Extension
 int getFactoryType()
          If this Object represents a Factory then this returns the type of the factory
 org.w3c.dom.Element getFirstChildElement(java.lang.String pElementName)
          Get the FirstChildElement of the BLXElement This Element would represent the Data Element of a BLXElement Node
 java.lang.String getHREF()
          Gets the HREF for this BLX Object's Data Element
 java.lang.String getID()
          Get a Unigue ID of this Component
 java.awt.Point getLocation()
          Get the XY Location of the Component that this BLX Element Represents
 java.net.URL getMainURL()
          Get the URL that all HREF attributes are relative to
 java.awt.Dimension getSize()
          Get the Size of the Component that this BLX Element Represents
 int getType()
          Get the Type that this Wrapper Object Represents
 java.lang.String getVersion()
          Get the Version of the Extension this BLX Object requires
protected  void processNode()
          Process the blxNode and setup all Attributes of this Wrapper Object
 void setClassName(java.lang.String pClassName)
          Set the ClassName of this BLX Object
 void setExtensionHREF(java.lang.String pHREF)
          Set the HREF for the URL to this Objects Extension
 void setExtensionName(java.lang.String pExtName)
          Set the Name of the Extension this BLX Object uses
 void setFactoryType(int pType)
          If this Object represents a Factory then this sets the Factory Type
 void setHREF(java.lang.String pHREF)
          Set the HREF URL of this BLX Object
 void setMainURL(java.net.URL pMainURL)
          URL that all HREF attributes will be relative to
 void setType(int pType)
          Set the Type that this Wrapper Object Represents
 void setVersion(java.lang.String pVersion)
          Set the Version of the Extension required by this BLX Object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLObjectWrapper

public XMLObjectWrapper()
Creates new XMLObjectWrapper

XMLObjectWrapper

public XMLObjectWrapper(java.net.URL pMainURL)
Creates new XMLObjectWrapper
Parameters:
pMainURL - - URL that all HREFS will be relative to

XMLObjectWrapper

public XMLObjectWrapper(java.net.URL pMainURL,
                        java.lang.String pBLXData)
                 throws InvalidBLXXMLException
Creates new XMLObjectWrapper
Parameters:
pMainURL - - URL that all HREFS will be relative to
pBLXData - - String XML that represents the BLX node and content
Throws:
InvalidBLXXMLException - if the pBLXData doesn't represent a BLX Node

XMLObjectWrapper

public XMLObjectWrapper(org.w3c.dom.Node pBLXNode,
                        java.net.URL pMainURL)
                 throws InvalidBLXXMLException
Creates new XMLObjectWrapper
Parameters:
pBLXDocument - - the root element should be a BLXElement
pMainURL - - URL that all HREFS will be relative to
Throws:
InvalidBLXXMLException - if the pBLXNode doesn't represent a BLX Node

XMLObjectWrapper

public XMLObjectWrapper(org.w3c.dom.Document pBLXDocument,
                        java.net.URL pMainURL)
                 throws InvalidBLXXMLException
Creates new XMLObjectWrapper
Parameters:
pBLXDocument - - the root element should be a BLXElement
pMainURL - - URL that all HREFS will be relative to
Throws:
InvalidBLXXMLException - if the Root Node of the Document doesn't represent a BLX Node
Method Detail

processNode

protected void processNode()
                    throws InvalidBLXXMLException
Process the blxNode and setup all Attributes of this Wrapper Object

getAbsoluteHREF

public java.net.URL getAbsoluteHREF()
Get the Absolute URL for the HREF attribute If the HREF attribute is not set then this returns null
Returns:
URL for Absolute HRef

setMainURL

public void setMainURL(java.net.URL pMainURL)
URL that all HREF attributes will be relative to
Parameters:
pMainURL -  

getMainURL

public java.net.URL getMainURL()
Get the URL that all HREF attributes are relative to
Returns:
URL

getType

public int getType()
Get the Type that this Wrapper Object Represents
Returns:
int (IXMLPersitable.OBJECT_TYPE, IXMLPersitable.COMP_TYPE, IXMLPersitable.FACTORY_TYPE)

setType

public void setType(int pType)
Set the Type that this Wrapper Object Represents
Parameters:
pType - (IXMLPersitable.OBJECT_TYPE, IXMLPersitable.COMP_TYPE, IXMLPersitable.FACTORY_TYPE)

getFactoryType

public int getFactoryType()
If this Object represents a Factory then this returns the type of the factory
Returns:
int (IXMLPersitable.OBJECT_FACTORY_TYPE , IXMLPersitable.COMPONET_FACTORY_TYPE)

setFactoryType

public void setFactoryType(int pType)
If this Object represents a Factory then this sets the Factory Type
Parameters:
pType - (IXMLPersitable.OBJECT_FACTORY_TYPE , IXMLPersitable.COMPONET_FACTORY_TYPE)

getClassName

public java.lang.String getClassName()
Get the ClassName for this BLX Object
Returns:
name of the Class

setClassName

public void setClassName(java.lang.String pClassName)
Set the ClassName of this BLX Object
Parameters:
pClassName -  

getExtensionName

public java.lang.String getExtensionName()
Get the Name of the Extension
Returns:
String

setExtensionName

public void setExtensionName(java.lang.String pExtName)
Set the Name of the Extension this BLX Object uses
Parameters:
pExtName -  

getExtensionHREF

public java.lang.String getExtensionHREF()
Get the Extension HREF
Returns:
HREF String

setExtensionHREF

public void setExtensionHREF(java.lang.String pHREF)
Set the HREF for the URL to this Objects Extension
Parameters:
pHREF - of Extension URL

getVersion

public java.lang.String getVersion()
Get the Version of the Extension this BLX Object requires
Returns:
String version of Extension

setVersion

public void setVersion(java.lang.String pVersion)
Set the Version of the Extension required by this BLX Object
Parameters:
pVersion - of Extension

getHREF

public java.lang.String getHREF()
Gets the HREF for this BLX Object's Data Element
Returns:
String URL

setHREF

public void setHREF(java.lang.String pHREF)
Set the HREF URL of this BLX Object
Parameters:
pHREF - String url of this Objects Data XML

createBLXElement

public org.w3c.dom.Element createBLXElement()
Create an BLX Element for this XML Object
Parameters:
Document - Owner to use to Create the Element
Returns:
Element

getBLXElement

public org.w3c.dom.Element getBLXElement()
Get the BLXElement that was used to create this Wrapper Object
Returns:
Element

getFirstChildElement

public org.w3c.dom.Element getFirstChildElement(java.lang.String pElementName)
Get the FirstChildElement of the BLXElement This Element would represent the Data Element of a BLXElement Node
Parameters:
pElementName - - name of the child element

getLocation

public java.awt.Point getLocation()
Get the XY Location of the Component that this BLX Element Represents
Returns:
Point or null if this is a BLX Object Element

getSize

public java.awt.Dimension getSize()
Get the Size of the Component that this BLX Element Represents
Returns:
Dimension or null if this is a BLX Object Element

getID

public java.lang.String getID()
Get a Unigue ID of this Component
Returns:
ID of this Component