com.vhosting.netconf.frame
Class Attribute

java.lang.Object
  extended by com.vhosting.netconf.frame.Identity
      extended by com.vhosting.netconf.frame.Attribute

public class Attribute
extends Identity

This class represents a generic attribute in a Netconf context.

Version:
1.00, 02/11/2010
Author:
Giuseppe Palmeri

Field Summary
 
Fields inherited from class com.vhosting.netconf.frame.Identity
name, namespaceURI, prefix
 
Constructor Summary
Attribute(Capability cap, java.lang.String name, java.lang.String value)
          Create an attribute with the namespace of the specified capability.
Attribute(java.lang.String name, java.lang.String value)
          Create an attribute with the default namespace.
 
Method Summary
static Attribute createDefaultNamespaceAttribute(Capability cap)
          Convenience methods to create an attribute declaring the default namespace definition.
 java.lang.String getValue()
          Get the attribute value.
 
Methods inherited from class com.vhosting.netconf.frame.Identity
getName, getNamespaceURI, getPrefix, getUniqueNane
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attribute

public Attribute(Capability cap,
                 java.lang.String name,
                 java.lang.String value)
Create an attribute with the namespace of the specified capability.

Parameters:
cap - The capability.
name - The name of the attribute.
value - The value of the attribute.

Attribute

public Attribute(java.lang.String name,
                 java.lang.String value)
Create an attribute with the default namespace. The default namespace in this implementation of Netconf is never used. When you use this constructor, you may need to define the default namespace with another Attribute instance assigned to the same scope or a higher scope. You can use the method createDefaultNamespaceAttribute(Capability cap) to create an attribute to be used in conjunction with this. As it is, this attribute does not have its own identity. Methods getUniqueName() and getPrefix() will return null.

Parameters:
name - The name of the attribute.
value - The value of the attribute.
See Also:
createDefaultNamespaceAttribute(Capability cap), Identity.getUniqueNane(), Identity.getPrefix()
Method Detail

createDefaultNamespaceAttribute

public static Attribute createDefaultNamespaceAttribute(Capability cap)
Convenience methods to create an attribute declaring the default namespace definition. The attribute generated is to be used in conjunction with attributes whose namespace is not defined.
 Example:
 
 If the namespace is 'http://www.example.com/example' then the
 attribute is:
 
    xmlns='http://www.example.com/example'
 
 

Parameters:
cap - The default capability namespace to declare.
Returns:
The attribute with the default namespace definition.
See Also:
Attribute(String name, String value)

getValue

public final java.lang.String getValue()
Get the attribute value.

Returns:
The attribute value.