DODS 7.6 API

com.lutris.dods.builder.generator.dataobject
Class NodeEnvelope

java.lang.Object
  extended by com.lutris.dods.builder.generator.dataobject.NodeEnvelope
All Implemented Interfaces:
XMLDataEnvelope, java.lang.Cloneable

public final class NodeEnvelope
extends java.lang.Object
implements XMLDataEnvelope

NodeEnvelope is an union of org.w3c.dom.Node and String.

Because we cannot be certain what data type application will relay on, the safest solution would be to introduce new class tath would hold both String and Node.

This envelope shall provide clear getters and setters while internally maintaining values in sync.

Version:
0.11
Author:
V.Puskas

Constructor Summary
NodeEnvelope()
           
 
Method Summary
 java.lang.Object clone()
           
 boolean compareAndSet(org.w3c.dom.Node toCompareWith)
           
 boolean compareAndSet(java.lang.String toCompareWith)
           
protected static java.lang.String convertNvalue(org.w3c.dom.Node value)
           
protected static org.w3c.dom.Node convertSvalue(java.lang.String value)
           
 org.w3c.dom.Node getNodeValue()
           
 java.lang.String getStringValue()
           
 void setNodeValue(org.w3c.dom.Node value)
           
 void setStringValue(java.lang.String value)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeEnvelope

public NodeEnvelope()
Method Detail

getNodeValue

public org.w3c.dom.Node getNodeValue()
                              throws java.lang.RuntimeException
Specified by:
getNodeValue in interface XMLDataEnvelope
Throws:
java.lang.RuntimeException

setNodeValue

public void setNodeValue(org.w3c.dom.Node value)
Specified by:
setNodeValue in interface XMLDataEnvelope

getStringValue

public java.lang.String getStringValue()
                                throws java.lang.RuntimeException
Specified by:
getStringValue in interface XMLDataEnvelope
Throws:
java.lang.RuntimeException

setStringValue

public void setStringValue(java.lang.String value)
Specified by:
setStringValue in interface XMLDataEnvelope

convertSvalue

protected static org.w3c.dom.Node convertSvalue(java.lang.String value)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

convertNvalue

protected static java.lang.String convertNvalue(org.w3c.dom.Node value)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

clone

public java.lang.Object clone()
Specified by:
clone in interface XMLDataEnvelope
Overrides:
clone in class java.lang.Object

compareAndSet

public boolean compareAndSet(org.w3c.dom.Node toCompareWith)
                      throws java.lang.RuntimeException
Specified by:
compareAndSet in interface XMLDataEnvelope
Throws:
java.lang.RuntimeException

compareAndSet

public boolean compareAndSet(java.lang.String toCompareWith)
Specified by:
compareAndSet in interface XMLDataEnvelope

DODS 7.6 API