Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.uda
Class SystemXMLElementWrapper

java.lang.Object
  extended bycom.ibm.etools.systems.core.ui.uda.SystemXMLElementWrapper
All Implemented Interfaces:
IAdaptable, ISystemUDAConstants
Direct Known Subclasses:
SystemUDActionElement, SystemUDTypeElement

public abstract class SystemXMLElementWrapper
extends Object
implements IAdaptable, ISystemUDAConstants

This is a base class for classes that wrapper xml elements. Eg, there are child classes to represent action xml elements, and type xml elements.


Field Summary
static String copyright
           
protected  Element elm
           
 
Fields inherited from interface com.ibm.etools.systems.core.ui.uda.ISystemUDAConstants
NAME_ATTR, ORIGINAL_NAME_ATTR, RELEASE_ATTR, XE_DOMAIN, XE_DOMNAME, XE_DOMTYPE
 
Constructor Summary
SystemXMLElementWrapper(Element elm, SystemUDBaseManager mgr, SystemProfile profile, int domainType)
          Constructor
 
Method Summary
 void deleteElement()
          Delete this element from the document
static Element findChildByName(Element parentElement, Document xdoc, String tagName, String searchName)
          For unique-name checking.
 Object getAdapter(Class adapterType)
          As required by the IAdaptable interface.
 String getAttribute(String attr, String defaultValue)
          Set the text value of the given attribute.
 boolean getBooleanAttribute(String attr)
          Return the boolean value of a given attribute.
 boolean getBooleanAttribute(String attr, boolean defaultValue)
          Return the boolean value of a given attribute.
 Vector getChildren(Vector children, Element parentElement, Document xdoc, SystemProfile profile)
          Given a parent element XML node, returns wrappers of all child tags of which we are interested Always returns a non-null vector, although it may be empty
static Vector getChildren(Vector children, Element parentElement, Document xdoc, SystemProfile profile, ISystemXMLElementWrapperFactory factory, int domain)
          Given a parent element XML node, returns wrappers all child tag elements with the given tag name Always returns a non-null vector, although it may be empty.
 Vector getChildren(Vector children, SystemProfile profile)
          Returns element wrappers of children (if this is a domain) or siblings
protected  Element getChildTag(String tagname, boolean create)
          Given a tag name, return the xml node for that child tag
 Document getDocument()
          Get the document this element is a part of
 int getDomain()
          Return the domain this element is in, or represents if it is a domain element itself.
 Element getElement()
          Get the XML document element this node wraps
 Vector getExistingNames()
          For unique-name checking.
 Vector getExistingNames(Element parentElement, Document xdoc)
          For unique-name checking.
static Vector getExistingNames(Element parentElement, Document xdoc, String tagName)
          For unique-name checking.
abstract  Image getImage()
           
 SystemUDBaseManager getManager()
          Get the manager that manages the document this element is part of.
 String getName()
          Return the value of this node's "Name" attribute
 String getOriginalName()
          For IBM-supplied elements that have been edited, returns the original IBM-supplied name
 Element getParentDomainElement()
          Get the parent xml domain element of this element.
 Element getParentElement()
          Get the parent xml element of this element.
 SystemProfile getProfile()
          Get the profile this is associated with
protected abstract  String getTagName()
           
protected  String getTextNode(String tagname)
          Given the name of a child xml tag, return the data for that tag
 String getVendor()
          Get the name of the vendor who supplied this user action or type.
 boolean isDomain()
          Is this a "Domain" tag?
 boolean isIBM()
          Return the value of this node's "IBM" attribute.
 boolean isUserChanged()
          Return the value of this node's "user-changed" attribute.
 void setAttribute(String attr, String value)
          Set the text value of the given attribute to a given value
 void setBooleanAttribute(String attr, boolean b)
          Set the value of a boolean attribute
 void setIBM(boolean isFromIBM)
          Set the value of this tag's "Vendor" attribute to "IBM", or clear the IBM attribute (after a duplication action for example).
 void setName(String s)
          Set the value of this tag's "Name" attribute.
protected  void setTextNode(String tagname, String val)
          Given the name of a child xml tag and a data value, update the data of that tag
 void setUserChanged(boolean isUserChanged)
          Set the value of this tag's "user-changed" attribute
 void setVendor(String vendor)
          Set the name of the vendor who supplied this user action or type
 String toString()
          Convert to a string Same as calling getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

elm

protected Element elm
Constructor Detail

SystemXMLElementWrapper

public SystemXMLElementWrapper(Element elm,
                               SystemUDBaseManager mgr,
                               SystemProfile profile,
                               int domainType)
Constructor

Parameters:
elm - - The actual xml document element for this action/type
mgr - - The parent manager of these actions/types
profile - - The system profile which owns this action
domainType - - The integer representation of the domain this is in (or this is, for a domain element)
Method Detail

getTagName

protected abstract String getTagName()

getImage

public abstract Image getImage()

toString

public String toString()
Convert to a string Same as calling getName


getAdapter

public Object getAdapter(Class adapterType)
As required by the IAdaptable interface.

Specified by:
getAdapter in interface IAdaptable
See Also:
IAdaptable.getAdapter(Class)

getProfile

public SystemProfile getProfile()
Get the profile this is associated with


getManager

public SystemUDBaseManager getManager()
Get the manager that manages the document this element is part of.


getElement

public Element getElement()
Get the XML document element this node wraps


getDocument

public Document getDocument()
Get the document this element is a part of


getParentDomainElement

public Element getParentDomainElement()
Get the parent xml domain element of this element. If domains aren't supported, this will return null


getParentElement

public Element getParentElement()
Get the parent xml element of this element. Only returns null if this is the root, which should never happen.


isDomain

public boolean isDomain()
Is this a "Domain" tag?


getDomain

public int getDomain()
Return the domain this element is in, or represents if it is a domain element itself. This is the integer representation used internally. Will be -1 if domains not supported for this subsystem.


getName

public String getName()
Return the value of this node's "Name" attribute


setName

public void setName(String s)
Set the value of this tag's "Name" attribute. If this is an IBM-supplied user action, then it will cause an addition attribute to be created named "OriginalName", containing the IBM-supplied name.


getOriginalName

public String getOriginalName()
For IBM-supplied elements that have been edited, returns the original IBM-supplied name


isIBM

public boolean isIBM()
Return the value of this node's "IBM" attribute. That is, is this an IBM-supplied tag?


setVendor

public void setVendor(String vendor)
Set the name of the vendor who supplied this user action or type


getVendor

public String getVendor()
Get the name of the vendor who supplied this user action or type. May be null, if created by a user


setIBM

public void setIBM(boolean isFromIBM)
Set the value of this tag's "Vendor" attribute to "IBM", or clear the IBM attribute (after a duplication action for example).


isUserChanged

public boolean isUserChanged()
Return the value of this node's "user-changed" attribute. That is, if this an IBM-supplied tag, has the user changed it?


setUserChanged

public void setUserChanged(boolean isUserChanged)
Set the value of this tag's "user-changed" attribute


deleteElement

public void deleteElement()
Delete this element from the document


getTextNode

protected String getTextNode(String tagname)
Given the name of a child xml tag, return the data for that tag


setTextNode

protected void setTextNode(String tagname,
                           String val)
Given the name of a child xml tag and a data value, update the data of that tag


getChildTag

protected Element getChildTag(String tagname,
                              boolean create)
Given a tag name, return the xml node for that child tag

Parameters:
tagname - - the name of the tag to find
create - - true if tag is to be created if not found

setBooleanAttribute

public void setBooleanAttribute(String attr,
                                boolean b)
Set the value of a boolean attribute


getBooleanAttribute

public boolean getBooleanAttribute(String attr)
Return the boolean value of a given attribute. It must exist!

Parameters:
attr - - name of the attribute to query

getBooleanAttribute

public boolean getBooleanAttribute(String attr,
                                   boolean defaultValue)
Return the boolean value of a given attribute.

Parameters:
attr - - name of the attribute to query
defaultValue - - value to return if the attribute is not found

getAttribute

public String getAttribute(String attr,
                           String defaultValue)
Set the text value of the given attribute. Specify a default value to return if the attribute is not found


setAttribute

public void setAttribute(String attr,
                         String value)
Set the text value of the given attribute to a given value


getExistingNames

public Vector getExistingNames()
For unique-name checking. If this is a domain element, returns all child action names. If this is an action/tag element, returns all sibling action names, minus this one. Always returns a non-null vector, although it may be empty


getExistingNames

public Vector getExistingNames(Element parentElement,
                               Document xdoc)
For unique-name checking. Given a parent element XML node, returns all child action names. Always returns a non-null vector, although it may be empty


getExistingNames

public static Vector getExistingNames(Element parentElement,
                                      Document xdoc,
                                      String tagName)
For unique-name checking. Given a parent element XML node, returns all child action names. Always returns a non-null vector of Strings, although it may be empty


getChildren

public Vector getChildren(Vector children,
                          SystemProfile profile)
Returns element wrappers of children (if this is a domain) or siblings


getChildren

public Vector getChildren(Vector children,
                          Element parentElement,
                          Document xdoc,
                          SystemProfile profile)
Given a parent element XML node, returns wrappers of all child tags of which we are interested Always returns a non-null vector, although it may be empty


getChildren

public static Vector getChildren(Vector children,
                                 Element parentElement,
                                 Document xdoc,
                                 SystemProfile profile,
                                 ISystemXMLElementWrapperFactory factory,
                                 int domain)
Given a parent element XML node, returns wrappers all child tag elements with the given tag name Always returns a non-null vector, although it may be empty. If the parentElement is null, uses the roots of the given document. Should only be true if domains not supported!

Returns:
Vector of SystemXMLElementWrapper objects

findChildByName

public static Element findChildByName(Element parentElement,
                                      Document xdoc,
                                      String tagName,
                                      String searchName)
For unique-name checking. Given a parent element XML node, returns the xml Element node with the given name attribute, or null if not found.


Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.