本文整理汇总了Java中javax.wsdl.Types.getExtensibilityElements方法的典型用法代码示例。如果您正苦于以下问题:Java Types.getExtensibilityElements方法的具体用法?Java Types.getExtensibilityElements怎么用?Java Types.getExtensibilityElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.wsdl.Types
的用法示例。
在下文中一共展示了Types.getExtensibilityElements方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseWSDLTypes
import javax.wsdl.Types; //导入方法依赖的package包/类
private void parseWSDLTypes( XSOMParser schemaParser )
throws IOException
{
Definition definition = getWSDLDefinition();
if ( definition != null ) {
Types types = definition.getTypes();
if ( types != null ) {
List<ExtensibilityElement> list = types.getExtensibilityElements();
for( ExtensibilityElement element : list ) {
if ( element instanceof SchemaImpl ) {
Element schemaElement = ((SchemaImpl) element).getElement();
Map<String, String> namespaces = definition.getNamespaces();
for( Entry<String, String> entry : namespaces.entrySet() ) {
if ( entry.getKey().equals( "xmlns" ) || entry.getKey().trim().isEmpty() ) {
continue;
}
if ( schemaElement.getAttribute( "xmlns:" + entry.getKey() ).isEmpty() ) {
schemaElement.setAttribute( "xmlns:" + entry.getKey(), entry.getValue() );
}
}
parseSchemaElement( definition, schemaElement, schemaParser );
}
}
}
}
}
示例2: importTypes
import javax.wsdl.Types; //导入方法依赖的package包/类
private void importTypes(Types types) {
SchemaCompiler compiler = XJC.createSchemaCompiler();
ErrorListener elForRun = new ConsoleErrorReporter();
compiler.setErrorListener(elForRun);
List<?> implementationTypes = types.getExtensibilityElements();
if (implementationTypes.size() == 0) {
return;
}
SchemaImpl impl = (SchemaImpl) implementationTypes.get(0);
S2JJAXBModel intermediateModel = this.compileModel(types, compiler, impl.getElement());
intermediateModel.generateCode(null, elForRun);
Collection<? extends Mapping> mappings = intermediateModel.getMappings();
for (Mapping mapping : mappings){
this.importStructure(mapping);
}
}
示例3: extractTypesSchema
import javax.wsdl.Types; //导入方法依赖的package包/类
public static org.jdom.Element extractTypesSchema(Definition wsdlDefinition) {
org.jdom.Element typesSchemaElm = null;
if (wsdlDefinition != null) {
Types types = wsdlDefinition.getTypes();
if (types != null) {
List extensibilityElements = types.getExtensibilityElements();
for (int i = 0; i < extensibilityElements.size(); i++) {
ExtensibilityElement schemaExtElem = (ExtensibilityElement) extensibilityElements.get(i);
if (schemaExtElem != null) {
QName elementType = schemaExtElem.getElementType();
if (elementType.getLocalPart().equals("schema")
&& (schemaExtElem instanceof UnknownExtensibilityElement)) {
Element element = ((UnknownExtensibilityElement) schemaExtElem).getElement();
DOMBuilder domBuilder = new DOMBuilder();
typesSchemaElm = domBuilder.build(element);
}
}
}
}
}
return typesSchemaElm;
}
示例4: readPackagesFromSchema
import javax.wsdl.Types; //导入方法依赖的package包/类
public Set<String> readPackagesFromSchema(Definition wsdlDefinition)
throws SchemaReaderException {
if (wsdlDefinition == null) {
if (log.isDebugEnabled()) {
log.debug("Invalid wsdl definition provided, NULL");
}
throw new SchemaReaderException(Messages.getMessage("SchemaReaderErr1"));
}
this.wsdlDefinition = wsdlDefinition;
List<Schema> schemaList = new ArrayList<Schema>();
Set<String> packageList = new TreeSet<String>();
//Add WSDL TargetNamespace
String namespace = wsdlDefinition.getTargetNamespace();
List packages = JavaUtils.getPackagesFromNamespace(namespace);
if (packages != null && packages.size() > 0) {
packageList.addAll(packages);
}
//Read All Schema Definition in wsdl;
Types types = wsdlDefinition.getTypes();
if (types == null) {
if (log.isDebugEnabled()) {
log.debug("WARNING: Could not find any Schema/Types from WSDL");
log.debug("no packages will derived from WSDL schema");
}
return packageList;
}
List extensibilityElements = types.getExtensibilityElements();
for (Object obj : extensibilityElements) {
if (obj != null && isSchema((ExtensibilityElement)obj)) {
Schema schema = (Schema)obj;
//process schemas and read packages from them.
processSchema(schema, schemaList, packageList);
}
}
//Set always stores unique objects, so I dont have to worry about removing duplicates from this set.
return packageList;
}