• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java XmlSchemaObject类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.ws.commons.schema.XmlSchemaObject的典型用法代码示例。如果您正苦于以下问题:Java XmlSchemaObject类的具体用法?Java XmlSchemaObject怎么用?Java XmlSchemaObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XmlSchemaObject类属于org.apache.ws.commons.schema包,在下文中一共展示了XmlSchemaObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getKey

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
public static String getKey(Object element) {
	String key = element.getClass().getSimpleName();
	if (element instanceof NamedList) {
		key = ((NamedList) element).getName().toLowerCase() + "_folder";
	} else if (element instanceof XmlSchema) {
		key = "schema";
	} else if (element instanceof XmlSchemaDocumentation || element instanceof XmlSchemaAppInfo) {
		key = "notation";
	}  else if (element instanceof XmlSchemaObject) {
		key = key.contains("Extension") ?
			"extension" :
			key.substring(9).replaceAll("(\\p{Upper})", "_$1").toLowerCase().substring(1);
		
		if (element instanceof XmlSchemaElement) {
			key += ((XmlSchemaElement)element).getRefName() != null ? "_ref":"";
		}
		else if (element instanceof XmlSchemaAttribute) {
			key += ((XmlSchemaAttribute)element).getRefName() != null ? "_ref":"";
		}
	} else {
		key = "unresolved";
	}
	return key;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:25,代码来源:SchemaViewLabelProvider.java


示例2: add

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
public static void add(XmlSchema schema, XmlSchemaObject object) {
	if (object instanceof XmlSchemaImport) {
		add(schema, (XmlSchemaImport) object);
	} else if (object instanceof XmlSchemaInclude) {
		add(schema, (XmlSchemaInclude) object);
	} else if (object instanceof XmlSchemaElement) {
		add(schema, (XmlSchemaElement) object);
	} else if (object instanceof XmlSchemaType) {
		add(schema, (XmlSchemaType) object);
	} else if (object instanceof XmlSchemaGroup) {
		add(schema, (XmlSchemaGroup) object);
	} else if (object instanceof XmlSchemaAttributeGroup) {
		add(schema, (XmlSchemaAttributeGroup) object);
	} else if (object instanceof XmlSchemaAttribute) {
		add(schema, (XmlSchemaAttribute) object);
	} else {
		schema.getItems().add(object);
	}
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:20,代码来源:XmlSchemaUtils.java


示例3: remove

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
public static void remove(XmlSchema schema, XmlSchemaObject object) {
	if (object instanceof XmlSchemaImport) {
		remove(schema, (XmlSchemaImport) object);
	} else if (object instanceof XmlSchemaInclude) {
		remove(schema, (XmlSchemaInclude) object);
	} else if (object instanceof XmlSchemaElement) {
		remove(schema, (XmlSchemaElement) object);
	} else if (object instanceof XmlSchemaType) {
		remove(schema, (XmlSchemaType) object);
	} else if (object instanceof XmlSchemaGroup) {
		remove(schema, (XmlSchemaGroup) object);
	} else if (object instanceof XmlSchemaAttributeGroup) {
		remove(schema, (XmlSchemaAttributeGroup) object);
	} else if (object instanceof XmlSchemaAttribute) {
		remove(schema, (XmlSchemaAttribute) object);
	} else {
		schema.getItems().remove(object);
	}
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:20,代码来源:XmlSchemaUtils.java


示例4: walkChoice

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
protected void walkChoice(XmlSchema xmlSchema, XmlSchemaChoice obj) {
	walkAnnotated(xmlSchema, obj);
       XmlSchemaObjectCollection children = obj.getItems();
       for (int i = 0; i < children.getCount(); i++) {
           XmlSchemaObject child = children.getItem(i);
           if (child instanceof XmlSchemaElement) {
           	walkElement(xmlSchema, (XmlSchemaElement)child);
           } else if (child instanceof XmlSchemaGroupRef) {
           	walkGroupRef(xmlSchema, (XmlSchemaGroupRef)child);
           } else if (child instanceof XmlSchemaChoice) {
           	walkChoice(xmlSchema, (XmlSchemaChoice)child);
           } else if (child instanceof XmlSchemaSequence) {
           	walkSequence(xmlSchema, (XmlSchemaSequence)child);
           } else if (child instanceof XmlSchemaAny) {
           	walkAny(xmlSchema, (XmlSchemaAny)child);
           }
       }
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:19,代码来源:XmlSchemaWalker.java


示例5: walkSequence

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
protected void walkSequence(XmlSchema xmlSchema, XmlSchemaSequence obj) {
	walkAnnotated(xmlSchema, obj);
       XmlSchemaObjectCollection children = obj.getItems();
       for (int i = 0; i < children.getCount(); i++) {
           XmlSchemaObject child = children.getItem(i);
           if (child instanceof XmlSchemaElement) {
           	walkElement(xmlSchema, (XmlSchemaElement)child);
           } else if (child instanceof XmlSchemaGroupRef) {
           	walkGroupRef(xmlSchema, (XmlSchemaGroupRef)child);
           } else if (child instanceof XmlSchemaChoice) {
           	walkChoice(xmlSchema, (XmlSchemaChoice)child);
           } else if (child instanceof XmlSchemaSequence) {
           	walkSequence(xmlSchema, (XmlSchemaSequence)child);
           } else if (child instanceof XmlSchemaAny) {
           	walkAny(xmlSchema, (XmlSchemaAny)child);
           }
       }
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:19,代码来源:XmlSchemaWalker.java


示例6: walkSimpleContentExtension

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
protected void walkSimpleContentExtension(XmlSchema xmlSchema, XmlSchemaSimpleContentExtension obj) {
	walkAnnotated(xmlSchema, obj);
	QName baseTypeName = obj.getBaseTypeName();
	if ((baseTypeName != null) && deep) {
		walkByTypeName(xmlSchema, baseTypeName);
	}
	
	XmlSchemaObjectCollection attributes = obj.getAttributes();
       for (int i = 0; i < attributes.getCount(); i++) {
           XmlSchemaObject attribute = attributes.getItem(i);
           if (attribute instanceof XmlSchemaAttribute) {
           	walkAttribute(xmlSchema, (XmlSchemaAttribute)attribute);
           } else if (attribute instanceof XmlSchemaAttributeGroupRef) {
           	walkAttributeGroupRef(xmlSchema, (XmlSchemaAttributeGroupRef)attribute);
           }
       }
	XmlSchemaAnyAttribute xmlSchemaAnyAttribute = obj.getAnyAttribute();
	if (xmlSchemaAnyAttribute != null) {
		walkAnyAttribute(xmlSchema, xmlSchemaAnyAttribute);
	}
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:22,代码来源:XmlSchemaWalker.java


示例7: walkAttributeGroup

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
protected void walkAttributeGroup(XmlSchema xmlSchema, XmlSchemaAttributeGroup obj) {
	walkAnnotated(xmlSchema, obj);
	XmlSchemaObjectCollection  attributes = obj.getAttributes();
       for (int i = 0; i < attributes.getCount(); i++) {
           XmlSchemaObject attribute = attributes.getItem(i);
           if (attribute instanceof XmlSchemaAttribute) {
           	walkAttribute(xmlSchema, (XmlSchemaAttribute)attribute);
           } else if (attribute instanceof XmlSchemaAttributeGroupRef) {
           	walkAttributeGroupRef(xmlSchema, (XmlSchemaAttributeGroupRef)attribute);
           }
       }
       XmlSchemaAnyAttribute xmlSchemaAnyAttribute = obj.getAnyAttribute();
       if (xmlSchemaAnyAttribute != null) {
       	walkAnyAttribute(xmlSchema, xmlSchemaAnyAttribute);
       }
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:17,代码来源:XmlSchemaWalker.java


示例8: getOperationQname

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
public QName getOperationQname(String operationName)
        throws UnknownOperationException {
    
    if ("rpc".equals(parser.getOperationStyle(null, operationName))) {
        QName rpcMethodName = parser.getRPCRequestMethodName(null, operationName);
        if (rpcMethodName == null) {
            parser.getRPCResponseMethodName(null, operationName);
        }
        
        return rpcMethodName;
    }
    
    // all these things are odd... there is no any wrapper for the 'document' style
    LinkedHashMap<String, XmlSchemaObject> parameters = parser.getInputParameters(null, operationName);
    if (parameters.size() > 0) {
        XmlSchemaObject xmlSchemaObject = parameters.values().iterator().next();
        if (xmlSchemaObject instanceof XmlSchemaElement) {
            XmlSchemaElement element = (XmlSchemaElement)xmlSchemaObject;
            return element.getQName();
        }
    }
    
    return null;
}
 
开发者ID:apache,项目名称:incubator-taverna-common-activities,代码行数:25,代码来源:WSDLParser.java


示例9: getParameter

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
private XmlSchemaObject getParameter(Part part) {
    XmlSchemaObject parameter;
    
    QName elementName = part.getElementName();
    if (elementName != null) {
        parameter = schemas.getElementByQName(elementName);
        if (parameter == null) {
            logger.log(Level.WARNING, "can't find a global element: {0} trying with type...", elementName);
            parameter = schemas.getTypeByQName(elementName);
        }
    } else {
        QName typeName = part.getTypeName();
        if (typeName != null) {
            parameter = schemas.getTypeByQName(typeName);
        } else {
            return null;
        }
    }
    
    return parameter;
}
 
开发者ID:apache,项目名称:incubator-taverna-common-activities,代码行数:22,代码来源:WSDL11Parser.java


示例10: getInputParameters

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
@Override
public LinkedHashMap<String, XmlSchemaObject> getInputParameters(String portName, String operationName) throws UnknownOperationException {
    LinkedHashMap<String, XmlSchemaObject> parameters = new LinkedHashMap<String, XmlSchemaObject>();

    BindingOperation bindingOperation = getBindingOperation(portName, operationName);
    InterfaceOperation interfaceOperation = bindingOperation.getInterfaceOperation();
    
    // NOTE THAT THIS CODE IS NOT VALID FOR "RPC" STYLE
    for (InterfaceMessageReference input : interfaceOperation.getInterfaceMessageReferences()) {
        if (Direction.IN == input.getDirection()) {
            ElementDeclaration element = input.getElementDeclaration();
            parameters.put(element.getName().getLocalPart(), (XmlSchemaObject)element.getContent());
        }
    }
    return parameters;
}
 
开发者ID:apache,项目名称:incubator-taverna-common-activities,代码行数:17,代码来源:WSDL20Parser.java


示例11: getOutputParameters

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
@Override
public LinkedHashMap<String, XmlSchemaObject> getOutputParameters(String portName, String operationName) throws UnknownOperationException {
    LinkedHashMap<String, XmlSchemaObject> parameters = new LinkedHashMap<String, XmlSchemaObject>();
    
    BindingOperation bindingOperation = getBindingOperation(portName, operationName);
    InterfaceOperation interfaceOperation = bindingOperation.getInterfaceOperation();
    
    // NOTE THAT THIS CODE IS NOT VALID FOR "RPC" STYLE
    for (InterfaceMessageReference output : interfaceOperation.getInterfaceMessageReferences()) {
        if (Direction.OUT == output.getDirection()) {
            ElementDeclaration element = output.getElementDeclaration();
            parameters.put(element.getName().getLocalPart(), (XmlSchemaObject)element.getContent());
        }
    }
    return parameters;
}
 
开发者ID:apache,项目名称:incubator-taverna-common-activities,代码行数:17,代码来源:WSDL20Parser.java


示例12: cacheComplexTypes

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
/**
 * extract all complex types from a schema and cache into a map
 */
private void cacheComplexTypes(XmlSchema schema) {
    XmlSchemaObjectCollection schemaItems = schema.getItems();

    int numElements = schemaItems.getCount();

    // Iterate XML Schema items
    for (int i = 0; i < numElements; i++) {
        XmlSchemaObject schemaObject = schemaItems.getItem(i);
        if (schemaObject instanceof XmlSchemaComplexType) {
            XmlSchemaComplexType complexType = (XmlSchemaComplexType) schemaObject;
            String elementTypeName = complexType.getName();
            complexTypes.put(elementTypeName, complexType);
        }
    }
}
 
开发者ID:inbloom,项目名称:secure-data-service,代码行数:19,代码来源:DidSchemaParser.java


示例13: parseParticleForIdentityType

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
/**
 * Recursively parse through an XmlSchemaPatricle to the elements
 * collecting all DidRefSources
 */
private XmlSchemaElement parseParticleForIdentityType(XmlSchemaParticle particle) {
    XmlSchemaElement identityType = null;
    if (particle != null) {
        if (particle instanceof XmlSchemaElement) {
            XmlSchemaElement element = (XmlSchemaElement) particle;
            String elementName = element.getSchemaTypeName().getLocalPart();
            if (elementName.contains(IDENTITY_TYPE)) {
                identityType = element;
            }
        } else if (particle instanceof XmlSchemaSequence) {
            XmlSchemaSequence schemaSequence = (XmlSchemaSequence) particle;
            for (int i = 0; i < schemaSequence.getItems().getCount(); i++) {
                XmlSchemaObject item = schemaSequence.getItems().getItem(i);
                if (item instanceof XmlSchemaParticle) {
                    identityType = parseParticleForIdentityType((XmlSchemaParticle) item);
                }
            }
        }
    }
    return identityType;
}
 
开发者ID:inbloom,项目名称:secure-data-service,代码行数:26,代码来源:DidSchemaParser.java


示例14: parseFields

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
private static final List<Attribute> parseFields(final XmlSchemaComplexType schemaComplexType,
        final XmlSchema schema, final Xsd2UmlConfig context) {
    final List<Attribute> attributes = new LinkedList<Attribute>();
    
    final XmlSchemaObjectCollection schemaItems = schemaComplexType.getAttributes();
    for (int i = 0, count = schemaItems.getCount(); i < count; i++) {
        final XmlSchemaObject schemaObject = schemaItems.getItem(i);
        if (schemaObject instanceof XmlSchemaAttribute) {
            final XmlSchemaAttribute schemaAttribute = (XmlSchemaAttribute) schemaObject;
            attributes.add(parseAttribute(schemaAttribute, schema, context));
            
        } else {
            throw new AssertionError(schemaObject);
        }
    }
    // parseAttributes(schemaComplexType.getAttributes(), schema);
    attributes.addAll(parseParticle(schemaComplexType.getParticle(), schema, context));
    
    return Collections.unmodifiableList(attributes);
}
 
开发者ID:inbloom,项目名称:secure-data-service,代码行数:21,代码来源:Xsd2UmlConvert.java


示例15: loadSchema

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
void loadSchema(XmlSchema schema) {
    XmlSchemaObjectCollection schemaItems = schema.getItems();

    // Iterate XML Schema items
    for (int i = 0; i < schemaItems.getCount(); i++) {
        XmlSchemaObject schemaObject = schemaItems.getItem(i);

        NeutralSchema neutralSchema;
        if (schemaObject instanceof XmlSchemaType) {
            neutralSchema = parse((XmlSchemaType) schemaObject, schema);
        } else if (schemaObject instanceof XmlSchemaElement) {
            neutralSchema = parseElement((XmlSchemaElement) schemaObject, schema);
        } else if (schemaObject instanceof XmlSchemaInclude) {
            continue; // nothing to do for includes
        } else {
            throw new RuntimeException("Unhandled XmlSchemaObject: " + schemaObject.getClass().getCanonicalName());
        }
        schemas.put(neutralSchema.getType(), neutralSchema);
        partialSchemas.clear();
    }
}
 
开发者ID:inbloom,项目名称:secure-data-service,代码行数:22,代码来源:XsdToNeutralSchemaRepo.java


示例16: updateLabel

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
private void updateLabel(String obText, QName qName, XmlSchemaObject object) {
	if (SchemaMeta.isDynamic(object)) {
		if (SchemaMeta.isReadOnly(object)) {
			lSummary.setText("Use the dynamic read-only "+obText+" : \n" + qName.toString());
			lSummary.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE));
		} else {
			lSummary.setText("Use the dynamic "+obText+" : \n" + qName.toString());
			lSummary.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN));
		}
	} else {
		lSummary.setText("Use the static "+obText+" : \n" + qName.toString());
		lSummary.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY));
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:15,代码来源:XmlQNameEditorComposite.java


示例17: getForeground

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
public Color getForeground(Object element) {
	if (element instanceof XmlSchemaObject) {
		XmlSchemaObject xso = (XmlSchemaObject) element;
		return Display.getCurrent().getSystemColor(
				SchemaMeta.isDynamic(xso) ?
						(SchemaMeta.isReadOnly(xso) ? SWT.COLOR_DARK_BLUE : SWT.COLOR_DARK_GREEN)
						: SWT.COLOR_DARK_GRAY
		);
	}
	return null;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:12,代码来源:SchemaViewLabelProvider.java


示例18: getTypesListFromXsd

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
private ArrayList<String> getTypesListFromXsd() {
	ArrayList<String> types = new ArrayList<String>();
	try {
		String tns = transaction.getProject().getTargetNamespace();
		String projectName = transaction.getProject().getName();
		XmlSchema schema = Engine.theApp.schemaManager.getSchemaForProject(projectName);
		QName responseTypeQName = new QName(tns, transaction.getXsdResponseTypeName());
		XmlSchemaComplexType xmlSchemaType = (XmlSchemaComplexType) schema.getTypeByName(responseTypeQName);
		XmlSchemaParticle xmlSchemaParticle = xmlSchemaType.getParticle();
		if (xmlSchemaParticle != null && xmlSchemaParticle instanceof XmlSchemaSequence) {
			XmlSchemaObjectCollection xmlSchemaObjectCollection = ((XmlSchemaSequence)xmlSchemaParticle).getItems();
			for (int i=0;i<xmlSchemaObjectCollection.getCount();i++) {
				XmlSchemaObject xso = xmlSchemaObjectCollection.getItem(i);
				if (xso instanceof XmlSchemaElement) {
					XmlSchemaElement xmlSchemaElement = (XmlSchemaElement)xso;
					String elName = xmlSchemaElement.getName();
					QName elType = xmlSchemaElement.getSchemaTypeName();
					String value = "<xsd:element name=\""+elName+"\" type=\""+elType.getPrefix()+":"+elType.getLocalPart()+"\"/>";
					types.add(value);
				}
			}
		}
	}
	catch (Exception e) {
	}
	return types;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:28,代码来源:TransactionXSDTypesDialogComposite.java


示例19: contains

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
public boolean contains(Object o) {
	if (o instanceof XmlSchemaObject) {
		return collection.indexOf((XmlSchemaObject) o) != -1;
	} else {
		return false;
	}
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:8,代码来源:XmlSchemaUtils.java


示例20: indexOf

import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
public int indexOf(Object o) {
	if (o instanceof XmlSchemaObject) {
		return collection.indexOf((XmlSchemaObject) o);
	} else {
		return -1;
	}
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:8,代码来源:XmlSchemaUtils.java



注:本文中的org.apache.ws.commons.schema.XmlSchemaObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GetFileInfoRequestProto类代码示例发布时间:2022-05-22
下一篇:
Java ConstraintDescriptions类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap