smacs.write.script
Class PsqlVariable
java.lang.Object
org.dom4j.tree.AbstractNode
org.dom4j.tree.AbstractBranch
org.dom4j.tree.AbstractElement
org.dom4j.tree.DefaultElement
smacs.tree.ScriptNode
smacs.write.script.PsqlScriptNode
smacs.write.script.PsqlScriptInvisibleNode
smacs.write.script.PsqlVariable
- All Implemented Interfaces:
- Branch, Cloneable, CreateListener, Element, EventListener, FixNode, FixNodeListener, GetName, GetSimpleNode, HasNodeHandler, HasNodeReferenceAttribute, smacs.tree.HasNodeReferenceId, HasPsqlName, HasPsqlNewName, HasPsqlTypeName, HasPsqlVariableName, IsaNodeReferenceChildListener, IsaNodeReferenceListener, NewSimpleNode, Node, Node, PrintScriptElement, PsqlSimpleNode, Serializable, SimpleElement, SimpleNode, SimpleNodeChild, SmacsFixNode
- Direct Known Subclasses:
- PsqlArgument, PsqlRecordVariable
- public class PsqlVariable
- extends PsqlScriptInvisibleNode
- implements HasPsqlTypeName, HasPsqlVariableName, HasPsqlNewName
internal Variable instance.
This is an invisible node in a syntaxtree - it lists the name of the variable,
the type and it knowns all the used-variable entitites. Through the usage it ensures
that its variable name is unique in the same scrope and that all reference to this
variable will be using the resolved variable name. Same for the type as in some parts
one needs to import it first.
- Author:
- Copyright (C) 2004, Guido Draheim. All rights reserved. Part of SMACS project.
- See Also:
- Serialized Form
| Fields inherited from interface org.dom4j.Node |
ANY_NODE, ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, MAX_NODE_TYPE, NAMESPACE_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, UNKNOWN_NODE |
| Methods inherited from class smacs.write.script.PsqlScriptNode |
adds, freezePsqlChildren, newNode, newNode, print, printPsqlChildren, printPsqlChildrenBlock, printPsqlChildrenBlock, printstring, resolve, resolvePsqlChildren |
| Methods inherited from class smacs.tree.ScriptNode |
_fixNodeTree, _getTokenValue, _getValueTokenValue, _hasTokenValue, _init, add, add, addAll, addAll, addChild, addChild, addNewNode, addNodeReference, addNodeReference, addNodeReference, addNodeReference, appendAttributes, appendText, clear, cloneFrom, contains, containsAll, countTokenName, dump, fireNodeReferenceChildHasChanged, fireNodeReferenceHasChanged, firstTokenName, firstTokenName, fixNode, fixNodeTree, get, getAttributeValue, getHandler, getId, getMember, getMember, getMember, getMember, getMemberChild, getMemberChild, getMemberChild, getMemberList, getMemberListChild, getMemberOption, getMemberOption, getMemberOption, getMemberValue, getMemberValue, getMemberValue, getNodeNameFromClassName, getNodeReferenceCount, getNodeReferenceCount, getNodeReferenceId, getNodeReferenceId, getOption, getOption, getOption, getParentNode, getParentNode, getParentNode, getParentNode, getSimpleNode, getSingleTextChild, getThisParentNode, getThisParentNode, getTokenName, getTokenValue, hasChildren, hasMember, hasMember, hasNodeHandler, hasNodeReference, hasNodeReferenceChildNodes, hasNodeReferenceChildNodes, hasNodeReferenceId, hasNodeReferenceId, hasSingleTextChild, hasTokenName, hasTokenValue, indexOf, isEmpty, iterator, jjtAccept, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, lastIndexOf, lastTokenName, lastTokenName, listIterator, listIterator, memberElement, newChildren, newNode, newNode, newNode, newNode, newNode, newNode, newNode, newNode, newNodeLike, newNodeReferenceAttribute, newNodeReferenceAttribute, newNodeReferenceId, newNodeReferenceId, onNodeReferenceChildHasChanged, onNodeReferenceHasChanged, printXML, printXML, removeAll, removeAttribute, removeChild, removeChild, removeNodeReference, replace, retainAll, set, setHandler, setMemberChild, setMemberChild, setMemberChild, setMemberList, setMemberListChild, setMemberOption, setMemberOption, setMemberOption, setMemberValue, setMemberValue, setMemberValue, setNodeReference, setNodeReference, setNodeReference, setOption, setOption, setOption, setOption, setTokenName, setTokenValue, size, strSingleTextChild, subList, toArray, toArray, toString, toString, toXML, toXML |
| Methods inherited from class org.dom4j.tree.DefaultElement |
add, additionalNamespaces, additionalNamespaces, addNewNode, attribute, attribute, attribute, attribute, attributeCount, attributeIterator, attributeList, attributeList, attributes, clearContent, clone, contentList, declaredNamespaces, element, element, element, elementIterator, elementIterator, elementIterator, elementIterator, elements, elements, elements, elements, getDocument, getDocumentFactory, getNamespaceForPrefix, getNamespaceForURI, getParent, getQName, getStringValue, getText, indexOf, node, nodeCount, nodeIterator, processingInstruction, processingInstructions, processingInstructions, remove, removeNode, removeProcessingInstruction, setAttributeList, setAttributes, setContent, setDocument, setParent, setQName, supportsParent |
| Methods inherited from class org.dom4j.tree.AbstractElement |
accept, add, add, add, add, add, add, add, add, addAttribute, addAttribute, addCDATA, addComment, addElement, addEntity, addNamespace, addNode, addProcessingInstruction, addProcessingInstruction, addText, asXML, attributeValue, attributeValue, attributeValue, attributeValue, childAdded, childRemoved, createAttributeList, createAttributeList, createCopy, createCopy, createCopy, createElement, createElement, createSingleIterator, elementText, elementText, elementTextTrim, elementTextTrim, ensureAttributesCapacity, getData, getName, getNamespace, getNamespacePrefix, getNamespaceURI, getNodeType, getPath, getQName, getQualifiedName, getUniquePath, getXPathNameStep, getXPathResult, hasMixedContent, isRootElement, isTextOnly, normalize, remove, remove, remove, remove, remove, remove, remove, remove, setAttributes, setAttributeValue, setAttributeValue, setData, setName, setNamespace, setText, write |
| Methods inherited from class org.dom4j.tree.AbstractBranch |
addElement, addElement, addElement, appendContent, content, contentRemoved, createContentList, createContentList, createEmptyList, createResultList, createSingleResultList, elementByID, elementID, getContentAsStringValue, getContentAsText, getTextTrim, hasContent, invalidNodeTypeAddException, isReadOnly, setProcessingInstructions |
| Methods inherited from class org.dom4j.tree.AbstractNode |
asXPathResult, createPattern, createXPath, createXPathFilter, createXPathResult, detach, getNodeTypeName, getPath, getUniquePath, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf |
| Methods inherited from interface smacs.tree.SimpleNode |
add, add, addAll, addAll, addChild, addChild, addNewNode, addNodeReference, addNodeReference, addNodeReference, addNodeReference, appendAttributes, appendText, clear, cloneFrom, contains, containsAll, countTokenName, dump, fireNodeReferenceChildHasChanged, fireNodeReferenceHasChanged, firstTokenName, firstTokenName, fixNode, fixNodeTree, get, getAttributeValue, getHandler, getId, getMember, getMember, getMember, getMember, getMemberChild, getMemberChild, getMemberChild, getMemberList, getMemberListChild, getMemberOption, getMemberOption, getMemberOption, getMemberValue, getMemberValue, getMemberValue, getNodeReferenceCount, getNodeReferenceCount, getNodeReferenceId, getNodeReferenceId, getOption, getOption, getOption, getParentNode, getParentNode, getParentNode, getParentNode, getSimpleNode, getSingleTextChild, getThisParentNode, getThisParentNode, getTokenName, getTokenValue, hasChildren, hasMember, hasMember, hasNodeHandler, hasNodeReference, hasNodeReferenceChildNodes, hasNodeReferenceChildNodes, hasNodeReferenceId, hasNodeReferenceId, hasSingleTextChild, hasTokenName, hasTokenValue, indexOf, isEmpty, iterator, jjtAccept, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, lastIndexOf, lastTokenName, lastTokenName, listIterator, listIterator, memberElement, newChildren, newNode, newNode, newNode, newNode, newNode, newNode, newNode, newNode, newNodeReferenceAttribute, onNodeReferenceChildHasChanged, onNodeReferenceHasChanged, printXML, printXML, removeAll, removeAttribute, removeChild, removeChild, removeNodeReference, replace, retainAll, set, setHandler, setMemberChild, setMemberChild, setMemberChild, setMemberList, setMemberListChild, setMemberOption, setMemberOption, setMemberOption, setMemberValue, setMemberValue, setMemberValue, setNodeReference, setNodeReference, setNodeReference, setOption, setOption, setOption, setOption, setTokenName, setTokenValue, size, strSingleTextChild, subList, toArray, toArray, toString, toString, toXML, toXML |
| Methods inherited from interface org.dom4j.Element |
add, add, add, add, add, addAttribute, addAttribute, addCDATA, addComment, addEntity, additionalNamespaces, addNamespace, addProcessingInstruction, addProcessingInstruction, addText, attribute, attribute, attribute, attributeCount, attributeIterator, attributes, attributeValue, attributeValue, attributeValue, attributeValue, createCopy, createCopy, createCopy, declaredNamespaces, element, element, elementIterator, elementIterator, elementIterator, elements, elements, elements, elementText, elementText, elementTextTrim, elementTextTrim, getData, getNamespace, getNamespaceForPrefix, getNamespaceForURI, getNamespacePrefix, getNamespaceURI, getQName, getQName, getQualifiedName, getStringValue, getText, getTextTrim, getXPathResult, hasMixedContent, isRootElement, isTextOnly, remove, remove, remove, remove, remove, setAttributes, setAttributeValue, setAttributeValue, setData, setQName |
| Methods inherited from interface org.dom4j.Branch |
add, add, add, add, addElement, addElement, addElement, appendContent, clearContent, content, elementByID, indexOf, node, nodeCount, nodeIterator, normalize, processingInstruction, processingInstructions, processingInstructions, remove, remove, remove, remove, removeProcessingInstruction, setContent, setProcessingInstructions |
| Methods inherited from interface org.dom4j.Node |
accept, asXML, asXPathResult, clone, createXPath, detach, getDocument, getName, getNodeType, getNodeTypeName, getParent, getPath, getPath, getUniquePath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, setParent, setText, supportsParent, valueOf, write |
PsqlVariable
public PsqlVariable(String name,
String type)
- constructor. type and name.
PsqlVariable
public PsqlVariable(String name,
String type,
PsqlExpression init)
- constructor. type and name and init-expr
PsqlVariable
public PsqlVariable(String name,
String type,
String init,
boolean string)
- constructor. type and name and preformatted init.
getPsqlVariableType
public PsqlVariableType getPsqlVariableType()
- internal
PsqlVariableType instance.
getVariableName
public String getVariableName()
getVariableType
public String getVariableType()
getVariableDefinition
public String getVariableDefinition()
getPsqlName
public String getPsqlName()
- Description copied from interface:
HasPsqlName
- returns resolved name to be used in scripts
- Specified by:
getPsqlName in interface HasPsqlName
getPsqlVariableName
public String getPsqlVariableName()
- Description copied from interface:
HasPsqlVariableName
- returns resolved variable name to be used in scripts
- Specified by:
getPsqlVariableName in interface HasPsqlVariableName
getPsqlTypeName
public String getPsqlTypeName()
- Description copied from interface:
HasPsqlTypeName
- returns resolved type name to be used in scripts
- Specified by:
getPsqlTypeName in interface HasPsqlTypeName
setInitPsqlExpression
public void setInitPsqlExpression(PsqlScriptNode init)
getInitPsqlExpression
public PsqlScriptNode getInitPsqlExpression()
newPsqlVariableUsed
public PsqlVariableUsed newPsqlVariableUsed()
used
public PsqlVariableUsed used()
freezePsqlVariableUsed
public boolean freezePsqlVariableUsed()
- freeze a PsqlVariable. Check if the declaration has been used actually as perhaps
some variables have been declared in the shell of some code but the core body was
left empty in regard to the variable. Only if it has been used then add a new
PsqlVariableUsed provoking a PsqlVariableDefinition in a parent place.
freeze
public void freeze()
- Specified by:
freeze in interface PsqlSimpleNode- Overrides:
freeze in class PsqlScriptNode
setPsqlNewName
public void setPsqlNewName(String newname)
- Description copied from interface:
HasPsqlNewName
- store the resolved name.
- Specified by:
setPsqlNewName in interface HasPsqlNewName
setResolveVariableName
public void setResolveVariableName(String newname)
print
public boolean print(PsqlPrintStream w)
- Specified by:
print in interface PsqlSimpleNode- Overrides:
print in class PsqlScriptInvisibleNode