KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > om > OMFactory


1 /*
2  * Copyright 2004,2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.axis2.om;
17
18 import javax.activation.DataHandler JavaDoc;
19 import javax.xml.namespace.QName JavaDoc;
20
21 /**
22  * Class OMFactory
23  */

24 public interface OMFactory {
25     /**
26      * @param localName
27      * @param ns
28      * @return
29      */

30     public OMElement createOMElement(String JavaDoc localName, OMNamespace ns);
31
32     /**
33      * @param localName
34      * @param ns
35      * @param parent
36      * @param builder
37      * @return
38      */

39     public OMElement createOMElement(String JavaDoc localName, OMNamespace ns,
40                                               OMContainer parent,
41                                               OMXMLParserWrapper builder);
42
43     /**
44      * This is almost the same as as createOMElement(localName,OMNamespace) method above.
45      * But some people may, for some reason, need to use the conventional method of putting a namespace.
46      * Or in other words people might not want to use the new OMNamespace.
47      * Well, this is for those people.
48      *
49      * @param localName
50      * @param namespaceURI
51      * @param namespacePrefix
52      * @return
53      */

54     public OMElement createOMElement(String JavaDoc localName,
55                                               String JavaDoc namespaceURI,
56                                               String JavaDoc namespacePrefix);
57
58     /**
59      * QName(localPart),
60      * QName(namespaceURI, localPart) - a prefix will be assigned to this
61      * QName(namespaceURI, localPart, prefix)
62      *
63      * @param qname
64      * @param parent
65      * @return
66      * @throws OMException
67      */

68     public OMElement createOMElement(QName JavaDoc qname, OMContainer parent)
69             throws OMException;
70
71     /**
72      * @param uri
73      * @param prefix
74      * @return
75      */

76     public OMNamespace createOMNamespace(String JavaDoc uri, String JavaDoc prefix);
77
78     /**
79      * @param parent
80      * @param text
81      * @return
82      */

83     public OMText createText(OMElement parent, String JavaDoc text);
84
85     /**
86      * @param s
87      * @return
88      */

89     public OMText createText(String JavaDoc s);
90     public OMText createText(String JavaDoc s, String JavaDoc mimeType, boolean optimize);
91     public OMText createText(DataHandler JavaDoc dataHandler, boolean optimize);
92     public OMText createText(OMElement parent, String JavaDoc s, String JavaDoc mimeType,
93             boolean optimize);
94
95     public OMAttribute createOMAttribute(String JavaDoc localName, OMNamespace ns, String JavaDoc value);
96
97
98
99     // make the constructor protected
100

101
102     
103 }
104
Popular Tags