edu.princeton.wordnet.ejb
Class NodeFactory

java.lang.Object
  extended by edu.princeton.wordnet.ejb.NodeFactory

 class NodeFactory
extends java.lang.Object

DOM node factory

Author:
Bernard Bou

Constructor Summary
NodeFactory()
           
 
Method Summary
static void makeAttribute(org.w3c.dom.Element thisNode, java.lang.String thisName, java.lang.String thisValue)
          Build node attribute
static org.w3c.dom.Node makeLexDomainNode(org.w3c.dom.Document thisDoc, org.w3c.dom.Node thisParent, java.lang.String thisValue)
          Make lexdomain node
static org.w3c.dom.Node makeLinkNode(org.w3c.dom.Document thisDoc, org.w3c.dom.Node thisParent, java.lang.String thisLinkType, int thisLevel)
          Make link node
static org.w3c.dom.Node makeMoreLinkNode(org.w3c.dom.Document thisDoc, org.w3c.dom.Node thisParent, java.lang.String thisLinkType, int thisLevel)
          Make 'more' link node (when recursiveness is broken and result is truncated)
static org.w3c.dom.Element makeNode(org.w3c.dom.Document thisDoc, org.w3c.dom.Node thisParent, java.lang.String thisName, java.lang.String thisText)
          Make versatile node
static org.w3c.dom.Node makePosNode(org.w3c.dom.Document thisDoc, org.w3c.dom.Node thisParent, java.lang.String thisValue)
          Make part-of-speech node
static org.w3c.dom.Node makeRootNode(org.w3c.dom.Document thisDoc, java.lang.String thisWord)
          Make root node
static org.w3c.dom.Node makeSenseNode(org.w3c.dom.Document thisDoc, org.w3c.dom.Node thisParent, int thisSenseIdx)
          Make sense node
static org.w3c.dom.Element makeSynsetNode(org.w3c.dom.Document thisDoc, org.w3c.dom.Node thisParent, int thisSize, long thisId)
          Make synset node
static org.w3c.dom.Node makeWordNode(org.w3c.dom.Document thisDoc, org.w3c.dom.Node thisParent, java.lang.String thisWord, long thisId)
          Make word (synset item) node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeFactory

NodeFactory()
Method Detail

makeNode

public static org.w3c.dom.Element makeNode(org.w3c.dom.Document thisDoc,
                                           org.w3c.dom.Node thisParent,
                                           java.lang.String thisName,
                                           java.lang.String thisText)
Make versatile node

Parameters:
thisDoc - is the DOM Document being built
thisParent - is the parent node to attach this node to
thisName - is the node's tag name
thisText - is the node's text content
Returns:
newly created node

makeAttribute

public static void makeAttribute(org.w3c.dom.Element thisNode,
                                 java.lang.String thisName,
                                 java.lang.String thisValue)
Build node attribute

Parameters:
thisNode - is the node to set attribute for
thisName - is the attribute's name
thisValue - is the attribute's value

makeRootNode

public static org.w3c.dom.Node makeRootNode(org.w3c.dom.Document thisDoc,
                                            java.lang.String thisWord)
Make root node

Parameters:
thisDoc - is the DOM Document being built
thisWord - is the target word
Returns:
newly created node

makePosNode

public static org.w3c.dom.Node makePosNode(org.w3c.dom.Document thisDoc,
                                           org.w3c.dom.Node thisParent,
                                           java.lang.String thisValue)
Make part-of-speech node

Parameters:
thisDoc - is the DOM Document being built
thisParent - is the parent node to attach this node to
thisValue - is the part-of-speech
Returns:
newly created node

makeLexDomainNode

public static org.w3c.dom.Node makeLexDomainNode(org.w3c.dom.Document thisDoc,
                                                 org.w3c.dom.Node thisParent,
                                                 java.lang.String thisValue)
Make lexdomain node

Parameters:
thisDoc - is the DOM Document being built
thisParent - is the parent node to attach this node to
thisValue -
Returns:
newly created node

makeSenseNode

public static org.w3c.dom.Node makeSenseNode(org.w3c.dom.Document thisDoc,
                                             org.w3c.dom.Node thisParent,
                                             int thisSenseIdx)
Make sense node

Parameters:
thisDoc - is the DOM Document being built
thisParent - is the parent node to attach this node to
thisSenseIdx - is the sense index
Returns:
newly created node

makeSynsetNode

public static org.w3c.dom.Element makeSynsetNode(org.w3c.dom.Document thisDoc,
                                                 org.w3c.dom.Node thisParent,
                                                 int thisSize,
                                                 long thisId)
Make synset node

Parameters:
thisDoc - is the DOM Document being built
thisParent - is the parent node to attach this node to
thisSize - is the synset's size (the number of words in the synset)
thisId - is the synset's id in the database
Returns:
newly created element

makeWordNode

public static org.w3c.dom.Node makeWordNode(org.w3c.dom.Document thisDoc,
                                            org.w3c.dom.Node thisParent,
                                            java.lang.String thisWord,
                                            long thisId)
Make word (synset item) node

Parameters:
thisDoc - is the DOM Document being built
thisParent - is the parent node to attach this node to
thisWord - is the target word
thisId - is the word id
Returns:
newly created node

makeLinkNode

public static org.w3c.dom.Node makeLinkNode(org.w3c.dom.Document thisDoc,
                                            org.w3c.dom.Node thisParent,
                                            java.lang.String thisLinkType,
                                            int thisLevel)
Make link node

Parameters:
thisDoc - is the DOM Document being built
thisParent - is the parent node to attach this node to
thisLinkType - is the link type
thisLevel - is the recursion level
Returns:
newly created node

makeMoreLinkNode

public static org.w3c.dom.Node makeMoreLinkNode(org.w3c.dom.Document thisDoc,
                                                org.w3c.dom.Node thisParent,
                                                java.lang.String thisLinkType,
                                                int thisLevel)
Make 'more' link node (when recursiveness is broken and result is truncated)

Parameters:
thisDoc - is the DOM Document being built
thisParent - is the parent node to attach this node to
thisLinkType - is the link type
thisLevel - is the recursion level
Returns:
newly created node