public class STMLElement extends nu.xom.Element implements XMLConstants
| Modifier and Type | Field and Description |
|---|---|
protected static AttributeFactory |
attributeFactory |
ATTRIBUTES, AUTOGENERATED_DONOTEDIT_S, BANNER_S, CATALOG_XML, CML_SIUNITS, CML_UNITS, ELEMENTS, FPX_REAL, JAVA_ARRAY, JAVA_BOOL, JAVA_BOOLEAN, JAVA_DOUB, JAVA_DOUBLE, JAVA_INT, JAVA_INTEGER, JAVA_STRING, PATTERN_ANYURI, PATTERN_QNAME, SVG_NS, SVG_NS_BASE, SVG_XPATH, TYPES, U_ANGSTROM, U_CELSIUS, U_DEGREE, U_KCAL, WARNING_S, X_OR, XHTML_NS, XLINK_NS, XLINK_PREFIX, XML_SUFF, XMLNS, XPATH_XSD, XSD_ANNOTATION, XSD_ANYURI, XSD_ATTRIBUTE, XSD_ATTRIBUTE_GROUP, XSD_BOOLEAN, XSD_COMPLEX_TYPE, XSD_DATE, XSD_DOCUMENTATION, XSD_DOUBLE, XSD_ELEMENT, XSD_ENUMERATION, XSD_EXTENSION, XSD_FLOAT, XSD_INTEGER, XSD_LENGTH, XSD_LIST, XSD_MAXEXCLUSIVE, XSD_MAXINCLUSIVE, XSD_MINEXCLUSIVE, XSD_MININCLUSIVE, XSD_NONNEGATIVEINTEGER, XSD_NS, XSD_PATTERN, XSD_POSITIVE_NUMBER, XSD_POSITIVEINTEGER, XSD_PREFIX, XSD_QNAME, XSD_RESTRICTION, XSD_SIMPLE_CONTENT, XSD_SIMPLE_TYPE, XSD_STRING, XSD_SUFF, XSD_UNION, XSD_XMLNSC_AMP, C_APOS, C_ATSIGN, C_BACKSLASH, C_BACKSPACE, C_CARET, C_COLON, C_COMMA, C_DEL, C_DOLLAR, C_EQUALS, C_FORMFEED, C_HASH, C_LANGLE, C_LBRAK, C_LCURLY, C_LSQUARE, C_MINUS, C_NBSP, C_NEWLINE, C_NL, C_PERCENT, C_PERIOD, C_PIPE, C_PLUS, C_POUND, C_QUERY, C_QUOT, C_RANGLE, C_RBRAK, C_RCURLY, C_RETURN, C_RSQUARE, C_SEMICOLON, C_SHRIEK, C_SLASH, C_SPACE, C_STAR, C_TAB, C_TILDE, C_UNDER, EPS, F_S, NONWHITEPUNC, NONWHITEPUNC0, NONWHITEPUNC0REGEX, ONE_THIRD, PUNC, S_AMP, S_APOS, S_ATSIGN, S_BACKSLASH, S_CARET, S_COLON, S_COMMA, S_DOLLAR, S_EMPTY, S_EQUALS, S_FORMFEED, S_HASH, S_LANGLE, S_LBRAK, S_LCURLY, S_LSQUARE, S_MINUS, S_NEWLINE, S_NL, S_PERCENT, S_PERIOD, S_PIPE, S_PLUS, S_POUND, S_QUERY, S_QUOT, S_RANGLE, S_RBRAK, S_RCURLY, S_RETURN, S_RSQUARE, S_SEMICOLON, S_SHRIEK, S_SLASH, S_SPACE, S_STAR, S_TAB, S_TILDE, S_UNDER, S_WHITEREGEX, TWO_THIRDS, U_S, WHITESPACE| Modifier | Constructor and Description |
|---|---|
protected |
STMLElement() |
|
STMLElement(STMLElement element)
copy constructor.
|
|
STMLElement(String name)
main constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addRemove(STMLAttribute att,
String value) |
static void |
addSTMLXAttribute(nu.xom.Element element,
String attName,
String attValue)
creates a prefixed STMLX attribute (cmlx:foo="bar") on element in STMLX namespace
|
void |
appendChild(nu.xom.Node child)
Appends a node to the children of this node.
|
nu.xom.Element |
copy()
copy node.
|
void |
copyAttributesFrom(nu.xom.Element element)
copies attributes.
|
static void |
copyAttributesFromTo(nu.xom.Element from,
nu.xom.Element to)
copy attributes from one STMLElement to another.
|
void |
copyChildrenFrom(nu.xom.Element element)
copies children of element make subclasses when required
|
static void |
copyChildrenFromTo(nu.xom.Element element,
nu.xom.Element to)
copies children of element make subclasses when required
|
protected static void |
createSubclassedChildren(nu.xom.Element oldElement,
STMLElement newElement) |
void |
debug()
debug for element.
|
void |
debug(int indent)
debug for element.
|
void |
debug(OutputStream os,
int indent)
debug.
|
void |
debug(String message)
debug for element.
|
static void |
deleteAttribute(nu.xom.Element element,
String attName)
it attribute exists detach it.
|
void |
detach()
re-route detach().
|
double |
getConstantToSI()
Additive constant to generate SI equivalent.
|
STMLAttribute |
getConstantToSIAttribute()
Additive constant to generate SI equivalent.
|
String |
getConvention()
A reference to a convention.
|
STMLAttribute |
getConventionAttribute()
A reference to a convention.
|
String |
getDataType()
The data type of the object.
|
STMLAttribute |
getDataTypeAttribute()
The data type of the object.
|
String |
getDelimiter()
null
|
STMLAttribute |
getDelimiterAttribute()
null
|
String |
getDictRef()
null
|
STMLAttribute |
getDictRefAttribute()
null
|
String |
getId()
null
|
STMLAttribute |
getIdAttribute()
null
|
String |
getNamespaceURIForPrefix(String prefix)
get namespace.
|
int |
getSize()
The size of an array or matrix.
|
STMLAttribute |
getSizeAttribute()
The size of an array or matrix.
|
protected String |
getSTMLAttributeValue(String name) |
String |
getSTMLXAttribute(String attName)
convenience method to get value of cmlx:foo attribute.
|
String |
getStringContent()
gets String content.
|
AbstractSTMTool |
getTool() |
String |
getUnits()
null
|
STMLAttribute |
getUnitsAttribute()
null
|
String |
getXMLContent() |
void |
insertChild(nu.xom.Node newNode,
int pos)
override insertChild.
|
static nu.xom.Attribute |
makeSTMLXAttribute(String attName,
String value)
convenience method to create new cmlx:foo attribute.
|
static STMLElement |
readAndCreateSTML(nu.xom.Element element) |
static STMLElement |
readAndCreateSTML(File file)
converts a SVG file to SVGElement
|
static STMLElement |
readAndCreateSTML(InputStream is)
converts a SVG file to SVGElement
|
void |
removeAttribute(String attName)
remove attribute.
|
void |
replaceChild(nu.xom.Node oldNode,
nu.xom.Node newNode)
override replaceChild.
|
void |
serialize(OutputStream os,
int indent)
convenience method to serialize the element.
|
void |
setDataType(String type) |
void |
setDelimiter(String value)
null
|
void |
setDictRef(String value)
null
|
void |
setLocalName(String localName)
override setLocalName(localName) to make it immutable.
|
void |
setSize(int value)
The size of an array or matrix.
|
void |
setSize(String value)
The size of an array or matrix.
|
void |
setSTMLXAttribute(String attName,
String attValue)
convenience method to add cmlx:foo attributes.
|
void |
setStringContent(String value)
sets String content.
|
void |
setTool(AbstractSTMTool tool) |
void |
setXMLContent(String value) |
protected void |
unknownAttributeName(String name)
throws Exception.
|
void |
writeHTML(Writer w)
write as HTML.
|
addAttribute, addNamespaceDeclaration, appendChild, getAttribute, getAttribute, getAttribute, getAttributeCount, getAttributeValue, getAttributeValue, getBaseURI, getChildElements, getChildElements, getChildElements, getFirstChildElement, getFirstChildElement, getLocalName, getNamespaceDeclarationCount, getNamespacePrefix, getNamespacePrefix, getNamespaceURI, getNamespaceURI, getQualifiedName, getValue, insertChild, removeAttribute, removeChildren, removeNamespaceDeclaration, setBaseURI, setNamespacePrefix, setNamespaceURI, shallowCopy, toString, toXMLprotected static AttributeFactory attributeFactory
protected STMLElement()
public STMLElement(String name)
name - tagnamepublic STMLElement(STMLElement element)
element - public static STMLElement readAndCreateSTML(nu.xom.Element element)
public static STMLElement readAndCreateSTML(File file)
file - public static STMLElement readAndCreateSTML(InputStream is)
is - protected static void createSubclassedChildren(nu.xom.Element oldElement,
STMLElement newElement)
public nu.xom.Element copy()
copy in class nu.xom.Elementpublic void copyAttributesFrom(nu.xom.Element element)
element - to copy frompublic void copyChildrenFrom(nu.xom.Element element)
element - to copy frompublic static void copyChildrenFromTo(nu.xom.Element element,
nu.xom.Element to)
element - to copy fromto - public void replaceChild(nu.xom.Node oldNode,
nu.xom.Node newNode)
replaceChild in class nu.xom.ParentNodeoldNode - newNode - public void insertChild(nu.xom.Node newNode,
int pos)
insertChild in class nu.xom.ParentNodenewNode - pos - public void detach()
detach in class nu.xom.Nodepublic void setLocalName(String localName)
setLocalName in class nu.xom.ElementlocalName - protected void unknownAttributeName(String name)
name - of attributepublic void removeAttribute(String attName)
attName - public static void copyAttributesFromTo(nu.xom.Element from,
nu.xom.Element to)
from - element to copy fromto - element to copy topublic static void deleteAttribute(nu.xom.Element element,
String attName)
element - attName - public void debug(String message)
message - public void debug()
public void debug(int indent)
indent - public void debug(OutputStream os, int indent) throws IOException
os - indent - IOExceptionpublic String getStringContent()
public void setStringContent(String value)
value - the XML text contentpublic void writeHTML(Writer w) throws IOException
w - writerIOExceptionpublic void serialize(OutputStream os, int indent) throws IOException
os - indent - to indent lines by (non-zero may muck up whitespace)IOExceptionpublic void setSTMLXAttribute(String attName, String attValue)
attName - WITHOUT prefixattValue - if null removes any old attributespublic static void addSTMLXAttribute(nu.xom.Element element,
String attName,
String attValue)
element - attName - UNPREFIXEDattValue - public static nu.xom.Attribute makeSTMLXAttribute(String attName, String value)
attName - WITHOUT prefix and colonvalue - if null undefinedpublic String getSTMLXAttribute(String attName)
attName - WITHOUT prefixpublic void appendChild(nu.xom.Node child)
Appends a node to the children of this node.
appendChild in class nu.xom.ParentNodechild - node to append to this nodenu.xom.IllegalAddException - if this node cannot have children
of this typeNullPointerException - if child is nullpublic AbstractSTMTool getTool()
public void setTool(AbstractSTMTool tool)
tool - the tool to setpublic void setDataType(String type)
public String getNamespaceURIForPrefix(String prefix)
prefix - public String getDataType()
public STMLAttribute getDataTypeAttribute()
public String getDelimiter()
public STMLAttribute getDelimiterAttribute()
public String getDictRef()
public void setDictRef(String value) throws RuntimeException
value - title valueRuntimeException - attribute wrong value/typepublic STMLAttribute getDictRefAttribute()
protected void addRemove(STMLAttribute att, String value)
public double getConstantToSI()
public STMLAttribute getConstantToSIAttribute()
public String getConvention()
public STMLAttribute getConventionAttribute()
public String getId()
public STMLAttribute getIdAttribute()
public String getUnits()
public STMLAttribute getUnitsAttribute()
public int getSize()
public STMLAttribute getSizeAttribute()
public void setDelimiter(String value) throws RuntimeException
value - title valueRuntimeException - attribute wrong value/typepublic void setSize(int value)
throws RuntimeException
value - title valueRuntimeException - attribute wrong value/typepublic void setSize(String value) throws RuntimeException
value - title valueRuntimeException - attribute wrong value/typepublic void setXMLContent(String value) throws RuntimeException
value - title valueRuntimeException - attribute wrong value/typepublic String getXMLContent()
Copyright © 1994–2024 Peter Murray-Rust. All rights reserved.