01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19:
20: package org.apache.axis2.jaxws.wrapper;
21:
22: import org.apache.axis2.jaxws.utility.PropertyDescriptorPlus;
23: import org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperException;
24:
25: import java.util.List;
26: import java.util.Map;
27:
28: /**
29: * The JAXBWrapper tool is used to create a JAXB Object from a series of child objects (wrap) or get
30: * the child objects from a JAXB Object (unwrap)
31: */
32: public interface JAXBWrapperTool {
33: /**
34: * unwrap Returns the list of child objects of the jaxb object
35: *
36: * @param jaxbObject that represents the type
37: * @param childNames list of xml child names as String
38: * @param pdMap PropertyDescriptorMap describing the jaxbObject
39: * @return list of Objects in the same order as the element names.
40: */
41: public Object[] unWrap(Object jaxbObject, List<String> childNames,
42: Map<String, PropertyDescriptorPlus> pdMap)
43: throws JAXBWrapperException;
44:
45: /**
46: * unwrap Returns the list of child objects of the jaxb object
47: *
48: * @param jaxbObject that represents the type
49: * @param childNames list of xml child names as String
50: * @return list of Objects in the same order as the element names. Note: This method creates a
51: * PropertyDescriptor map; thus it is less performant than the other unWrap method
52: */
53: public Object[] unWrap(Object jaxbObject, List<String> childNames)
54: throws JAXBWrapperException;
55:
56: /**
57: * wrap Creates a jaxb object that is initialized with the child objects.
58: * <p/>
59: * Note that the jaxbClass must be the class the represents the complexType. (It should never be
60: * JAXBElement)
61: *
62: * @param jaxbClass
63: * @param childNames list of xml child names as String
64: * @param childObjects, component type objects
65: * @param pdMap PropertyDescriptorMap describing the jaxbObject
66: */
67: public Object wrap(Class jaxbClass, List<String> childNames,
68: Map<String, Object> childObjects,
69: Map<String, PropertyDescriptorPlus> pdMap)
70: throws JAXBWrapperException;
71:
72: /**
73: * wrap Creates a jaxb object that is initialized with the child objects.
74: * <p/>
75: * Note that the jaxbClass must be the class the represents the complexType. (It should never be
76: * JAXBElement)
77: *
78: * @param jaxbClass
79: * @param childNames list of xml child names as String
80: * @param childObjects, component type objects
81: * @param pdMap PropertyDescriptorMap describing the jaxbObject Note: This method
82: * creates a PropertyDescriptor map; thus it is less performant than the
83: * other unWrap method
84: */
85: public Object wrap(Class jaxbClass, List<String> childNames,
86: Map<String, Object> childObjects)
87: throws JAXBWrapperException;
88:
89: }
|