1 /*
2 * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
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
17 package org.opensaml.xml;
18
19 import javax.xml.namespace.QName;
20
21 import org.w3c.dom.Element;
22
23 /**
24 * A builder for XMLObjects.
25 *
26 * @param <XMLObjectType> the XMLObject type that this builder produces
27 */
28 public interface XMLObjectBuilder<XMLObjectType extends XMLObject> {
29
30 /**
31 * Creates an XMLObject with a given fully qualified name.
32 *
33 * @param objectName fully qualified name of the object
34 *
35 * @return the constructed XMLObject
36 */
37 public XMLObjectType buildObject(QName objectName);
38
39 /**
40 * Creates an XMLObject with a given fully qualified name and schema type.
41 *
42 * @param objectName fully qualified name of the object
43 * @param schemaType the schema type of the Element represented by this XMLObject
44 *
45 * @return the constructed XMLObject
46 */
47 public XMLObjectType buildObject(QName objectName, QName schemaType);
48
49 /**
50 * Creates an XMLObject with a given fully qualified name.
51 *
52 * @param namespaceURI the URI of the namespace the Element represented by this XMLObject will be in
53 * @param localName the local name of the Element represented by this XMLObject
54 * @param namespacePrefix the namespace prefix of the Element represented by this XMLObject
55 *
56 * @return the constructed XMLObject
57 */
58 public XMLObjectType buildObject(String namespaceURI, String localName, String namespacePrefix);
59
60 /**
61 * Creates an XMLObject with a given fully qualified name.
62 *
63 * @param namespaceURI the URI of the namespace the Element represented by this XMLObject will be in
64 * @param localName the local name of the Element represented by this XMLObject
65 * @param namespacePrefix the namespace prefix of the Element represented by this XMLObject
66 * @param schemaType the schema type of the Element represented by this XMLObject
67 *
68 * @return the constructed XMLObject
69 */
70 public XMLObjectType buildObject(String namespaceURI, String localName, String namespacePrefix, QName schemaType);
71
72 /**
73 * Creates an XMLObject using information from the given DOM element. This method must set the QName for the Element
74 * QName within the constructed XMLObject.
75 *
76 * This method is used by {@link org.opensaml.xml.io.AbstractXMLObjectUnmarshaller}.
77 *
78 * @param element the DOM Element containing information about the object to be built.
79 *
80 * @return the constructed XMLObject
81 */
82 public XMLObjectType buildObject(Element element);
83 }