"WEBNMS_5 API Docs"

com.adventnet.management.config.xml
Class BaseElement

java.lang.Object
  extended by com.adventnet.management.config.xml.BaseElement
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Attribute, AttributeResult, ConfigResult, ConfigTask, Context, DataSource, Device, DeviceList, DeviceResult, DeviceTaskMap, Enum, Form, GoTo, Initialization, InventoryInput, InventoryUpdate, MOInput, MOUpdate, NEInput, OperationIdentifier, OperationStatus, Property, ProtocolMap, Qualifier, Script, SQLInput, SQLUpdate, Stage, StageResult, Table, Template, TemplateParams, TemplateResult, UserAttribute, UserInput

public class BaseElement
extends java.lang.Object
implements java.io.Serializable

This class represents Element Nodes in a XML and provides various methods for manipulating the XML.

See Also:
Serialized Form

Field Summary
protected  org.w3c.dom.Element element
          This is the element that represents this object in the XML
static boolean isServer
           
 
Constructor Summary
BaseElement()
          This constructor should only be used by the Template class
BaseElement(org.w3c.dom.Element element)
          This constructor requires an XML element.
 
Method Summary
 BaseElement addSubTag(BaseElement be)
          Add a new sub tag.
 java.lang.String getAttribute(java.lang.String name)
          Method used to get the value of an attribute.
 org.w3c.dom.Element getElement()
          Returns the XML Element Node of this BaseElement Class.
 java.util.Properties getProperties()
          Convert the attributes (parameters) into a properties object.
 java.util.Vector getSubTagsByName(java.lang.String name)
          Returns the list of sub-tags as tag classes matching given tag value For eg., in order to view the subtags such as Device in an XML file getSubTagsByName("Device") can be used.
 boolean hasAttribute(java.lang.String name)
          Returns true when an attribute with a given name is already present on this element or has a default value, false otherwise.
 void removeSubTagsByName(java.lang.String name)
          This method is used to remove the subTags specified by the name.
 void setAttribute(java.lang.String name, java.lang.String value)
          Method used to add an attribute.
 void setProperties(java.util.Properties properties)
          Convert the properties object into attributes (parameters).
 java.lang.String toString()
          Returns the XML by transforming the Element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

element

protected org.w3c.dom.Element element
This is the element that represents this object in the XML


isServer

public static boolean isServer
Constructor Detail

BaseElement

public BaseElement()
This constructor should only be used by the Template class


BaseElement

public BaseElement(org.w3c.dom.Element element)
            throws InvalidTemplateException
This constructor requires an XML element.

Parameters:
element - the root element on which the BaseElement is to be constructed.
Throws:
InvalidTemplateException - if the element is null.
Method Detail

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Method used to get the value of an attribute.

Parameters:
name - name of the property whose value is requested.
Returns:
the attribute's value.

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
Method used to add an attribute.

Parameters:
name - name of the attribute that needs to be added.
value - attribute's value

hasAttribute

public boolean hasAttribute(java.lang.String name)
Returns true when an attribute with a given name is already present on this element or has a default value, false otherwise.

Parameters:
name - name of the attribute to look for.
Returns:
true if an attribute with the given name is specified on this element or has a default value, false otherwise.

getSubTagsByName

public java.util.Vector getSubTagsByName(java.lang.String name)
                                  throws InvalidTemplateException
Returns the list of sub-tags as tag classes matching given tag value For eg., in order to view the subtags such as Device in an XML file getSubTagsByName("Device") can be used.

Parameters:
name - sub-tag's name.
Returns:
a Vector containing Objects specifying the given SubTag Name.
Throws:
InvalidTemplateException - if any of the sub-tag objects could not be got.

addSubTag

public BaseElement addSubTag(BaseElement be)
Add a new sub tag.

Parameters:
be - the BaseElement of the tag to be added.
Returns:
a BaseElement which would contain the new subTag that's being set.

removeSubTagsByName

public void removeSubTagsByName(java.lang.String name)
This method is used to remove the subTags specified by the name.

Parameters:
name - name of the sub-tag that's to be removed.

toString

public java.lang.String toString()
Returns the XML by transforming the Element.

Overrides:
toString in class java.lang.Object
Returns:
a String representing the element in XML.

getElement

public org.w3c.dom.Element getElement()
Returns the XML Element Node of this BaseElement Class.


getProperties

public java.util.Properties getProperties()
Convert the attributes (parameters) into a properties object.

Returns:
attributes in a Properties form if present, else null.

setProperties

public void setProperties(java.util.Properties properties)
Convert the properties object into attributes (parameters).

Parameters:
properties - the properties list that have to be converted into attributes.

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.