Class PackageSetBuilder
java.lang.Object
org.apache.axis2.jaxws.runtime.description.marshal.impl.PackageSetBuilder
In order to marshal or unmarshal the user data, we need to know the set of packages involved.
The set of packages is used to construct an appropriate JAXBContext object during the
marshalling/unmarshalling.
There are two ways to get this data.
Schema Walk (preferred): Get the list of packages by walking the schemas that are referenced by
the wsdl (or generated wsdl). Each schema represents a different package. The package is
obtained using the jaxb customization or JAXB default ns<->package rule.
Annotation Walk(secondary) : Walk the list of Endpoints, Operations, Parameters, etc. and build a
list of packages by looking at the classes involved.
The Schema Walk is faster and more complete, but relies on the presence of the schema or wsdl.
The Annotation Walk is slower and is not complete. For example, the annotation walk may not
discover the packages for derived types that are defined in a different schema than the formal
parameter types.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetPackageFromClass(Class cls) Return the package associated with the class name.static StringgetPackageFromClassName(String className) Return the package associated with the class name.getPackagesFromAnnotations(org.apache.axis2.jaxws.description.ServiceDescription serviceDesc, MarshalServiceRuntimeDescription msrd) getPackagesFromSchema(org.apache.axis2.jaxws.description.ServiceDescription serviceDesc) Walks the schemas of the serviceDesc's wsdl (or generated wsdl) to determine the list of packages.
-
Method Details
-
getPackagesFromSchema
public static TreeSet<String> getPackagesFromSchema(org.apache.axis2.jaxws.description.ServiceDescription serviceDesc) Walks the schemas of the serviceDesc's wsdl (or generated wsdl) to determine the list of packages. This is the preferred algorithm for discovering the package set.- Parameters:
serviceDesc- ServiceDescription- Returns:
- Set of Packages
-
getPackagesFromAnnotations
public static TreeSet<String> getPackagesFromAnnotations(org.apache.axis2.jaxws.description.ServiceDescription serviceDesc, MarshalServiceRuntimeDescription msrd) - Parameters:
serviceDescription- ServiceDescription- Returns:
- Set of Packages
-
getPackageFromClassName
Return the package associated with the class name. The className may not be specified (in which case a null Package is returned). If class has anunnamed package return ""- Parameters:
className- String (may be null or empty)- Returns:
- String or null if problems occur
-
getPackageFromClass
Return the package associated with the class name. The className may not be specified (in which case a null Package is returned). if class has unnamed package return ""- Parameters:
cls- Class- Returns:
- String or null
-