OSDN Git Service

Set optimal mime types and executable settings.
[mikumikustudio/MikuMikuStudio.git] / src / com / jmex / xml / xml / AnyTypeNode.java
1 /**
2  * AnyTypeNode.java
3  *
4  * This file was generated by XMLSpy 2007sp2 Enterprise Edition.
5  *
6  * YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
7  * OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.
8  *
9  * Refer to the XMLSpy Documentation for further details.
10  * http://www.altova.com/xmlspy
11  */
12
13
14 package com.jmex.xml.xml;
15
16 import com.jmex.xml.types.SchemaString;
17 import com.jmex.xml.types.SchemaType;
18
19 public class AnyTypeNode extends Node {
20
21         public AnyTypeNode(AnyTypeNode node) {
22                 super(node);
23         }
24
25         public AnyTypeNode(org.w3c.dom.Node node) {
26                 super(node);
27         }
28
29         public AnyTypeNode(org.w3c.dom.Document doc) {
30                 super(doc);
31         }
32
33         public AnyTypeNode(Document doc, String namespaceURI, String prefix, String name) {
34                 super(doc, namespaceURI, prefix, name);
35         }
36         
37         public SchemaString getValue() {
38                 return new SchemaString(getDomNodeValue(dereference(domNode)));
39                 // TODO this should be: return new SchemaString(getDomNodeValue(domNode));
40         }
41
42         public void setValue(SchemaType value) {
43                 setDomNodeValue(domNode, value.toString());
44         }
45
46         public void assign(SchemaType value) {
47                 setValue(value);
48         }
49         
50         public org.w3c.dom.Node getFirstChildElement(String namespaceURI, String name ) {
51                 return getDomFirstChild(com.jmex.xml.xml.Node.Element,  namespaceURI, name );
52         }
53         
54         public org.w3c.dom.Node getNextChildElement(String namespaceURI, String name, org.w3c.dom.Node childNode ) {
55                 return getDomNextChild(com.jmex.xml.xml.Node.Element, namespaceURI, name, childNode);
56         }
57         
58         public void appendChildElement(String namespaceURI, String name, com.jmex.xml.xml.Node node) throws Exception {
59                 if (node.getDomNode().getNodeType() != org.w3c.dom.Node.ELEMENT_NODE)
60                         throw new XmlException("appendChildElement: Node is not an element");
61
62                 //domNode.appendChild(cloneDomElementAs(namespaceURI, name, node));or
63                 domNode.appendChild(node.getDomNode());
64         }
65         
66         public org.w3c.dom.Node createNewChildElement(String namespaceURI, String name) {
67                 org.w3c.dom.Element newDomNode = domNode.getOwnerDocument().createElementNS(namespaceURI, name);
68                 domNode.appendChild(newDomNode);
69                 return newDomNode;
70         }
71         
72         public org.w3c.dom.Node appendChildElement(String namespaceURI, String name, String value) {
73                 return appendDomChild(com.jmex.xml.xml.Node.Element, namespaceURI, name, value);
74         }
75         
76         /*
77         public org.w3c.dom.Node appendChildElement(String namespaceURI, String name, String type, String value) {
78                 org.w3c.dom.Element domElement = (org.w3c.dom.Element)appendDomChild(com.jmex.xml.xml.Node.Element, namespaceURI, name, value);
79                 domElement.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:type", type);
80         } */
81         
82         public void adjustPrefix() {
83         }
84         
85         public void addTextNode(String value) throws Exception {
86                 appendDomChild(Text, null, null, value.toString());
87         }
88         
89         public void addComment(String value) throws Exception {
90                         appendDomChild(Comment, null, null, value.toString());
91         }
92                 
93         public void addCDataNode(String value) throws Exception {
94                         appendDomChild(CData, null, null, value.toString());
95         }
96         
97         public void addProcessingInstruction(String name, String value) throws Exception {
98                         appendDomChild(ProcessingInstruction, null, name.toString(), value.toString());
99         }
100 }