public class WebServiceUtils extends Object
Constructor and Description |
---|
WebServiceUtils() |
Modifier and Type | Method and Description |
---|---|
Map<PackageFacade,String> |
addPkgAbbr(PackageFacade pkg,
String pkgAbbr)
Adds the package namespace abbreviation for this package
|
String |
createConstructor(ModelElementFacade facade)
Supplies a result for type =
|
String |
createConstructor(ModelElementFacade facade,
boolean useMany)
Supplies a result for type =
|
String |
createConstructor(ModelElementFacade facade,
boolean useMany,
ModelElementFacade parent)
Supplies a result for type =
|
Collection<ModelElementFacade> |
getAllowedOperationExceptions(PackageFacade packageFacade)
Get all operations under WebService or with WebServiceOperation in a package
|
List<WebServiceOperation> |
getAllowedOperations(PackageFacade packageFacade)
Get all operations under WebService or with WebServiceOperation in a package
|
Collection<Role> |
getAllRoles(Collection<Service> services)
Retrieves all roles from the given
services collection. |
static String |
getDate()
Returns the current Date in the specified format.
|
static String |
getDate(String format)
Returns the current Date in the specified format.
|
String |
getElementClassName(String elementName,
String namespace)
Gets the fully qualified name of a class given the XML Element Name and namespace.
|
Collection<PackageFacade> |
getExceptionReferences(PackageFacade packageFacade)
Creates a list of referenced exception packages for each package.
|
static String |
getPackageName(String namespace)
Creates the package name from the element namespace, following the JAXB rules.
|
Collection<PackageFacade> |
getPackageReferences(PackageFacade packageFacade,
boolean follow)
Creates a list of referenced packages for each package.
|
Collection<PackageFacade> |
getPackageReferences(WebServiceLogicImpl service,
Set<MetafacadeBase> types,
String packageName,
boolean follow)
Creates a list of referenced packages for each package.
|
Collection<PackageFacade> |
getPackages(WebServiceLogicImpl service,
Set<ModelElementFacade> types,
boolean follow)
Creates a list of referenced packages for the service.
|
Collection<ModelElementFacade> |
getPackageTypes(PackageFacade packageFacade,
boolean follow)
Filter schema types list and related object to only a single package.
|
Collection<ModelElementFacade> |
getPackageTypes(WebServiceLogicImpl service,
Set<MetafacadeBase> types,
String packageName,
boolean follow)
Filter schema types list and related object to only a single package.
|
String |
getPkgAbbr(PackageFacade pkg)
Get the package namespace abbreviation for this package
|
String |
getPkgAbbr(PackageFacade pkg,
PackageFacade currentPackage)
Get the package namespace abbreviation for this package
|
static String |
getSchemaType(ClassifierFacade type,
TypeMappings schemaTypeMappings,
String namespacePrefix,
String qName,
String wrappedArrayTypePrefix,
boolean withPrefix,
boolean preserveArray)
Creates and returns the schema type for the given
type . |
Collection<PackageFacade> |
getServiceDescendantPackages(WebServiceLogicImpl service,
boolean follow)
Creates a list of referenced packages for all subclasses referenced by the service.
|
Collection<ModelElementFacade> |
getServiceReferences(WebServiceLogicImpl service,
boolean follow)
Creates a list of referenced types for the service.
|
String |
getTypeMapping(TypeMappings mappings,
String from)
Determine how a model type is mapped to a java implementation type.
|
boolean |
hasComplexTypes(ClassifierFacade facade,
boolean follow)
Determine if an object has schema complex types (associations, multiplicity > 1, or complex attributes).
|
static boolean |
isSimpleType(ModelElementFacade element)
Returns true if java.lang.* or java.util.* datatype and not many*
|
static String |
reversePackage(String packageName)
Reverses the
packageName . |
public WebServiceUtils()
public Collection<Role> getAllRoles(Collection<Service> services)
services
collection.services
- the collection services.public Collection<PackageFacade> getPackages(WebServiceLogicImpl service, Set<ModelElementFacade> types, boolean follow)
service
- WebServiceLogicImpl The service for which to find referenced packagestypes
- Setfollow
- Follow Inheritance references $extensionInheritanceDisabledpublic Map<PackageFacade,String> addPkgAbbr(PackageFacade pkg, String pkgAbbr)
pkg
- Package for which to get the abbreviation. Uses a static Map so that
all schemas globally for this model will use the same namespace abbreviationspkgAbbr
- Package Abbreviation to be added to namespace mappublic String getPkgAbbr(PackageFacade pkg)
pkg
- Package for which to get the abbreviation. Uses a static Map so that
all schemas globally for this model will use the same namespace abbreviationspublic String getPkgAbbr(PackageFacade pkg, PackageFacade currentPackage)
pkg
- Package for which to get the abbreviation. Uses a static Map so that
all schemas globally for this model will use the same namespace abbreviationscurrentPackage
- The package which is referencing the pkg. Return 'impl' if the same as pkg.public Collection<PackageFacade> getPackageReferences(WebServiceLogicImpl service, Set<MetafacadeBase> types, String packageName, boolean follow)
service
- WebService containing WS operations with references.types
- CollectionpackageName
- Package / namespace for which to find all related (referenced) packagesfollow
- Follow Inheritance references $extensionInheritanceDisabledpublic Collection<PackageFacade> getExceptionReferences(PackageFacade packageFacade)
packageFacade
- Package / namespace for which to find all related (referenced) packagespublic Collection<PackageFacade> getPackageReferences(PackageFacade packageFacade, boolean follow)
packageFacade
- Package / namespace for which to find all related (referenced) packagesfollow
- Follow Inheritance references $extensionInheritanceDisabledpublic List<WebServiceOperation> getAllowedOperations(PackageFacade packageFacade)
packageFacade
- Package / namespace for which to find all service operationspublic Collection<ModelElementFacade> getAllowedOperationExceptions(PackageFacade packageFacade)
packageFacade
- Package / namespace for which to find all service operationspublic Collection<ModelElementFacade> getPackageTypes(PackageFacade packageFacade, boolean follow)
packageFacade
- Package / namespace for which to find all related (referenced) packagesfollow
- Follow Inheritance references $extensionInheritanceDisabledpublic Collection<ModelElementFacade> getPackageTypes(WebServiceLogicImpl service, Set<MetafacadeBase> types, String packageName, boolean follow)
service
- WebService containing WS operations with references.types
- CollectionpackageName
- Package / namespace for which to find all related (referenced) packagesfollow
- Follow Inheritance references $extensionInheritanceDisabledpublic boolean hasComplexTypes(ClassifierFacade facade, boolean follow)
facade
- Type to determine if it contains complex typesfollow
- Follow inheritance hierarchy for type when determining complex typespublic static String getPackageName(String namespace)
namespace
- the XML namespace.public String getElementClassName(String elementName, String namespace)
elementName
- the XML element name.namespace
- the XML namespace for the element.public String createConstructor(ModelElementFacade facade)
facade
- Type to create default object forpublic String createConstructor(ModelElementFacade facade, boolean useMany)
facade
- Type to create default object foruseMany
- Return constructor with multiplicity type instead of underlying typepublic String createConstructor(ModelElementFacade facade, boolean useMany, ModelElementFacade parent)
facade
- Type to create default object foruseMany
- Return constructor with multiplicity type instead of underlying typeparent
- Object containing this facade, which may have an attribute named dependency to a different typepublic Collection<PackageFacade> getServiceDescendantPackages(WebServiceLogicImpl service, boolean follow)
service
- WebService containing WS operations with references.follow
- Follow Inheritance references $extensionInheritanceDisabledpublic Collection<ModelElementFacade> getServiceReferences(WebServiceLogicImpl service, boolean follow)
service
- WebService containing WS operations with references.follow
- Follow Inheritance references $extensionInheritanceDisabledpublic static String reversePackage(String packageName)
packageName
.packageName
- the package name to reverse.public static String getDate(String format)
format
- The format for the output datepublic static String getDate()
public String getTypeMapping(TypeMappings mappings, String from)
mappings
- from
- public static String getSchemaType(ClassifierFacade type, TypeMappings schemaTypeMappings, String namespacePrefix, String qName, String wrappedArrayTypePrefix, boolean withPrefix, boolean preserveArray)
Creates and returns the schema type for the given type
.
It finds the mapped schema type from the passed in
schemaTypeMappings
.
type
- the ClassifierFacade instanceschemaTypeMappings
- contains the mappings from model datatypes to
schema datatypes.namespacePrefix
- the prefix given to the schema type if it's a
custom type (non XSD type).qName
- the qualified namewrappedArrayTypePrefix
- a prefix to give to wrapped array types.withPrefix
- a flag indicating whether or not the type should have
the prefix definedpreserveArray
- true/false, if true then if the schema type is an
array we'll preserve the fact that its an array and return an
array schema type name. If false we will return back the non array
type even if its an array.public static boolean isSimpleType(ModelElementFacade element)
Returns true if java.lang.* or java.util.* datatype and not many*
element
- the ClassifierFacade instanceCopyright © 2003–2014 AndroMDA.org. All rights reserved.