KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > om > impl > llom > factory > OMLinkedListImplFactory


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.impl.llom.factory;
17
18 import org.apache.axis2.om.*;
19 import org.apache.axis2.om.impl.llom.OMAttributeImpl;
20 import org.apache.axis2.om.impl.llom.OMElementImpl;
21 import org.apache.axis2.om.impl.llom.OMNamespaceImpl;
22 import org.apache.axis2.om.impl.llom.OMTextImpl;
23
24 import javax.activation.DataHandler JavaDoc;
25 import javax.xml.namespace.QName JavaDoc;
26
27 /**
28  * Class OMLinkedListImplFactory
29  */

30 public class OMLinkedListImplFactory implements OMFactory {
31     /**
32      * Field MAX_TO_POOL
33      */

34     public static final int MAX_TO_POOL = 100;
35
36     /**
37      * Method createOMElement
38      *
39      * @param localName
40      * @param ns
41      * @return
42      */

43     public OMElement createOMElement(String JavaDoc localName, OMNamespace ns) {
44         OMElementImpl element = new OMElementImpl(localName, ns);
45         return element;
46     }
47
48     /**
49      * Method createOMElement
50      *
51      * @param localName
52      * @param ns
53      * @param parent
54      * @param builder
55      * @return
56      */

57     public OMElement createOMElement(String JavaDoc localName, OMNamespace ns,
58                                      OMContainer parent,
59                                      OMXMLParserWrapper builder) {
60         OMElementImpl element = new OMElementImpl(localName, ns, parent,
61                 builder);
62         return element;
63     }
64
65     /**
66      * Method createOMElement
67      *
68      * @param localName
69      * @param namespaceURI
70      * @param namespacePrefix
71      * @return
72      */

73     public OMElement createOMElement(String JavaDoc localName, String JavaDoc namespaceURI,
74                                      String JavaDoc namespacePrefix) {
75         return this.createOMElement(localName,
76                 this.createOMNamespace(namespaceURI,
77                         namespacePrefix));
78     }
79
80     /**
81      * Method createOMElement
82      *
83      * @param qname
84      * @param parent
85      * @return
86      * @throws OMException
87      */

88     public OMElement createOMElement(QName JavaDoc qname, OMContainer parent)
89             throws OMException {
90         return new OMElementImpl(qname, parent);
91     }
92
93     /**
94      * Method createOMNamespace
95      *
96      * @param uri
97      * @param prefix
98      * @return
99      */

100     public OMNamespace createOMNamespace(String JavaDoc uri, String JavaDoc prefix) {
101         return new OMNamespaceImpl(uri, prefix);
102     }
103
104     /**
105      * Method createText
106      *
107      * @param parent
108      * @param text
109      * @return
110      */

111     public OMText createText(OMElement parent, String JavaDoc text) {
112         OMTextImpl textNode = new OMTextImpl(parent, text);
113         return textNode;
114     }
115
116     /**
117      * Method createText
118      *
119      * @param s
120      * @return
121      */

122     public OMText createText(String JavaDoc s) {
123         OMTextImpl textNode = new OMTextImpl(s);
124     ;
125         return textNode;
126     }
127
128     public OMText createText(String JavaDoc s, String JavaDoc mimeType, boolean optimize) {
129         return new OMTextImpl(s, mimeType, optimize);
130     }
131
132     public OMText createText(DataHandler JavaDoc dataHandler, boolean optimize) {
133         return new OMTextImpl(dataHandler, optimize);
134     }
135
136     public OMText createText(OMElement parent, String JavaDoc s, String JavaDoc mimeType, boolean optimize) {
137         return new OMTextImpl(parent, s, mimeType, optimize);
138     }
139
140     public OMAttribute createOMAttribute(String JavaDoc localName, OMNamespace ns, String JavaDoc value) {
141           return new OMAttributeImpl(localName, ns, value);
142       }
143
144
145 }
146
Popular Tags