wxtpages
Class unitTextContent

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended bywxtpages.unit
          extended bywxtpages.unitTextContent
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.tree.MutableTreeNode, java.io.Serializable, javax.swing.tree.TreeNode

public class unitTextContent
extends unit

Instances of unitTextContent handles import and preparation of formatted or non-formatted text. The source file need not be formatted. The extract may be interpreted as strait text (a textnode) or as acontent of a documentfragment.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class wxtpages.unit
CONTENT_TYPE, DBCONTENT_TYPE, GROUP_TYPE, m_absoluteUri, m_description, m_Doc, m_GroupMaster, m_lastTimeUsed, m_myElement, m_name, m_optionMap, m_originalUri, m_parameterMap, m_propertyMap, m_txtContent, m_type, PAGE_TYPE, TEMPLATE_TYPE, TEXTCONTENT_TYPE, TRANSFORMATION_TYPE, UNIT_TYPE
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
unitTextContent(unitGroup master, org.w3c.dom.Element elt, unit owner)
          Creates a new instance of unitTextContent from script.
unitTextContent(unitGroup master, java.lang.String loc, unit owner)
          Creates a new instance of unitTextContent based on an importcommand (PI)
 
Method Summary
protected  java.lang.String getExtractedText()
          Get the text extracted from between left parenthesis and right parenthesis.
protected  java.lang.String getExtractedText(java.lang.String left, java.lang.String right)
          Get the text we can extract based on parameters as parenthesis
 org.w3c.dom.NodeList getNodeList(command cmd)
          Get a list of nodes according to the xpath specifyed in cmd
 boolean prepare(unit p, java.lang.String theCommonName, java.lang.String theCommonValue)
          Prepare the text in this textunit Does nothing at the moment.
protected  java.lang.String wash(java.lang.String type, java.lang.String txt)
          Preserve special characters as std entities
protected  java.lang.String wrapEntities(java.lang.String entities, java.lang.String txt)
          wrap up as entities
 
Methods inherited from class wxtpages.unit
addTransformationParameters, browseUnit, build, calculateAbsoluteAddress, controlLinks, correctAllAddressingInDocument, correctAllAddressingInFragment, correctOneCommonLink, correctStyleAttributes, correctStyleElements, correctStyleString, displayProperties, editUnit, establishDom, getAbsoluteUri, getAbsoluteUriAsString, getAsText, getDescription, getDoc, getDocCopy, getEncoding, getFileName, getName, getOption, getOptions, getOriginalAsString, getOriginalUri, getProperties, getReporter, getTransformation, getTransformationAsString, getTransformationID, getTransformationParameterMap, getType, getURItoAsString, isSameAs, isUpdatedAfterUse, killDocument, loadAsText, makeComment, makeImageRefToPage, makeRefToPage, saveFromDOM, setEncoding, setNowAsLastTimeUsed, setReporter, setTransformationFromString, setTransformationId, setUpPopMenu, toString
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

unitTextContent

public unitTextContent(unitGroup master,
                       org.w3c.dom.Element elt,
                       unit owner)
                throws java.lang.Exception
Creates a new instance of unitTextContent from script.

Parameters:
master - The unitGroup object that owns this content object
elt - The element in the script that defines this unitContent object
owner - The unit that owns this unitContent, a unitPage-object
Throws:
java.lang.Exception - When the object cannot be established

unitTextContent

public unitTextContent(unitGroup master,
                       java.lang.String loc,
                       unit owner)
                throws java.lang.Exception
Creates a new instance of unitTextContent based on an importcommand (PI)

Parameters:
master - The unitGroup object that owns this content object
loc - Where the unitContent object is stored
owner - The unit that owns this unitContent, normally a unitPage-object
Throws:
java.lang.Exception - When the object cannot be established
Method Detail

getNodeList

public org.w3c.dom.NodeList getNodeList(command cmd)
Get a list of nodes according to the xpath specifyed in cmd

Overrides:
getNodeList in class unit
Parameters:
cmd - the command that controls the listproduction
Returns:
null, allways

prepare

public boolean prepare(unit p,
                       java.lang.String theCommonName,
                       java.lang.String theCommonValue)
Prepare the text in this textunit Does nothing at the moment. May be set up to parse as text and change addresses etc

Overrides:
prepare in class unit
Parameters:
p - The unit that will own the content, may not be null
theCommonName - The name of commons
theCommonValue - The value of commons
Returns:
false if a fatal error occurs during preparation, true otherwise

getExtractedText

protected java.lang.String getExtractedText()
Get the text extracted from between left parenthesis and right parenthesis.

Returns:
The extracted string if we can extract, the whole contentstring if either parenthesis are null.

getExtractedText

protected java.lang.String getExtractedText(java.lang.String left,
                                            java.lang.String right)
Get the text we can extract based on parameters as parenthesis

Parameters:
left - Temporary left parenthesis
right - Temporary right parenthesis
Returns:
The extracted string if we can extract, the whole contentstring if either parameters are null.

wash

protected java.lang.String wash(java.lang.String type,
                                java.lang.String txt)
Preserve special characters as std entities

Parameters:
type - the wash we want, only code is implemented

wrapEntities

protected java.lang.String wrapEntities(java.lang.String entities,
                                        java.lang.String txt)
wrap up as entities

Parameters:
entities - a commaseparated list