org.apache.ws.sandbox.security.trust.message.token
Class AbstractToken

java.lang.Object
  extended byorg.apache.ws.sandbox.security.trust.message.token.AbstractToken
Direct Known Subclasses:
AllowPostdating, CompositeElement, Renewing, RequestedTokenCancelled, ValueElement

public abstract class AbstractToken
extends java.lang.Object

Author:
Ruchith Fernando (ruchith.fernando@gmail.com)

Field Summary
protected  org.w3c.dom.Document document
           
protected  org.w3c.dom.Element element
           
 
Constructor Summary
AbstractToken(org.w3c.dom.Document doc)
          Create a new token with the given document
AbstractToken(org.w3c.dom.Element elem)
          Tihs constructor accepts a DOM Element instance Will populate the internal properties
 
Method Summary
protected  void addChild(AbstractToken token)
           
protected abstract  void deserializeChildElement(org.w3c.dom.Element elem)
          This is called for each of the immediate child elements of type Node.ELEMENT_NODE of this token
protected  org.w3c.dom.Element getElement()
          Returns this element
protected abstract  javax.xml.namespace.QName getToken()
          This metod is used to provide the QName of the element to the constructors by the extending types
 void parse(org.w3c.dom.Element elem)
          Parses the immediate children of the current token and calls the deserializeChildElement method or deserializeElementText
protected  void removeChild(AbstractToken token)
           
protected  void setElement(org.w3c.dom.Element element)
          Sets this element
protected abstract  void setElementTextValue(org.w3c.dom.Text textNode)
          This is called with a Text node of the current element
 java.lang.String toString()
          To display the token
 
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

document

protected org.w3c.dom.Document document
Constructor Detail

AbstractToken

public AbstractToken(org.w3c.dom.Document doc)
Create a new token with the given document

Parameters:
doc -

AbstractToken

public AbstractToken(org.w3c.dom.Element elem)
              throws WSTrustException
Tihs constructor accepts a DOM Element instance Will populate the internal properties

Parameters:
elem -
Throws:
WSSecurityException
WSTrustException
Method Detail

getToken

protected abstract javax.xml.namespace.QName getToken()
This metod is used to provide the QName of the element to the constructors by the extending types

Returns:

parse

public void parse(org.w3c.dom.Element elem)
           throws WSTrustException
Parses the immediate children of the current token and calls the deserializeChildElement method or deserializeElementText

Parameters:
elem -
Throws:
WSSecurityException
WSTrustException

deserializeChildElement

protected abstract void deserializeChildElement(org.w3c.dom.Element elem)
                                         throws WSTrustException
This is called for each of the immediate child elements of type Node.ELEMENT_NODE of this token

Parameters:
elem - The child element
Throws:
WSSecurityException
WSTrustException

setElementTextValue

protected abstract void setElementTextValue(org.w3c.dom.Text textNode)
                                     throws WSTrustException
This is called with a Text node of the current element

Parameters:
textNode -
Throws:
WSTrustException

getElement

protected org.w3c.dom.Element getElement()
Returns this element

Returns:

setElement

protected void setElement(org.w3c.dom.Element element)
Sets this element

Parameters:
element -

toString

public java.lang.String toString()
To display the token


addChild

protected void addChild(AbstractToken token)

removeChild

protected void removeChild(AbstractToken token)


Copyright © 2004-2008 Apache Web Services. All Rights Reserved.