本文整理汇总了Java中org.apache.ws.commons.schema.XmlSchemaComplexType.getParticle方法的典型用法代码示例。如果您正苦于以下问题:Java XmlSchemaComplexType.getParticle方法的具体用法?Java XmlSchemaComplexType.getParticle怎么用?Java XmlSchemaComplexType.getParticle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ws.commons.schema.XmlSchemaComplexType
的用法示例。
在下文中一共展示了XmlSchemaComplexType.getParticle方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleAllCasesOfComplexTypes
import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
private void handleAllCasesOfComplexTypes(XmlSchemaType schemaType,
AxisMessage message,
List partNameList,
String qnameSuffix) throws CodeGenerationException {
// if a complex type name exits for a element then
// we keep that complex type to support unwrapping
if (schemaType instanceof XmlSchemaComplexType) {
XmlSchemaComplexType cmplxType = (XmlSchemaComplexType) schemaType;
if (cmplxType.getContentModel() == null) {
if (cmplxType.getParticle() != null) {
processXMLSchemaSequence(cmplxType.getParticle(), message, partNameList,
qnameSuffix);
}
} else {
// now lets handle case with extensions
processComplexContentModel(cmplxType, message, partNameList, qnameSuffix);
}
// handle attributes here
processAttributes(cmplxType, message, partNameList, qnameSuffix);
}
}
示例2: extractParticle
import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
/**
* Extract a particle from a complex type
* returns null if it can't be extracted.
*/
private XmlSchemaParticle extractParticle(XmlSchemaComplexType complexType) {
XmlSchemaParticle particle = complexType.getParticle();
// handle case where the complexType is an extension
if (particle == null && complexType.getContentModel() != null
&& complexType.getContentModel().getContent() != null) {
XmlSchemaContent content = complexType.getContentModel().getContent();
if (content instanceof XmlSchemaComplexContentExtension) {
XmlSchemaComplexContentExtension complexContent = (XmlSchemaComplexContentExtension) content;
particle = complexContent.getParticle();
}
}
return particle;
}
示例3: getTypesListFromXsd
import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的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;
}
示例4: walkComplexType
import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
protected void walkComplexType(XmlSchema xmlSchema, XmlSchemaComplexType 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);
}
}
XmlSchemaContentModel xmlSchemaContentModel = obj.getContentModel();
XmlSchemaParticle xmlSchemaParticle = obj.getParticle();
if (xmlSchemaContentModel != null) {
if (xmlSchemaContentModel instanceof XmlSchemaSimpleContent) {
walkSimpleContent(xmlSchema, (XmlSchemaSimpleContent)xmlSchemaContentModel);
} else if (xmlSchemaContentModel instanceof XmlSchemaComplexContent) {
walkComplexContent(xmlSchema, (XmlSchemaComplexContent)xmlSchemaContentModel);
}
} else if (xmlSchemaParticle != null) {
if (xmlSchemaParticle instanceof XmlSchemaSequence) {
walkSequence(xmlSchema, (XmlSchemaSequence)xmlSchemaParticle);
} else if (xmlSchemaParticle instanceof XmlSchemaChoice) {
walkChoice(xmlSchema, (XmlSchemaChoice)xmlSchemaParticle);
} else if (xmlSchemaParticle instanceof XmlSchemaAll) {
walkAll(xmlSchema, (XmlSchemaAll)xmlSchemaParticle);
} else if (xmlSchemaParticle instanceof XmlSchemaGroupRef) {
walkGroupRef(xmlSchema, (XmlSchemaGroupRef)xmlSchemaParticle);
}
}
}
示例5: getParameterListForOperation
import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
/**
* Retrieves list of parameter names & their type for a given operation
* @param operation
*/
private static String getParameterListForOperation(AxisOperation operation) {
//Logic copied from BuilderUtil.buildsoapMessage(...)
StringBuffer paramList = new StringBuffer();
AxisMessage axisMessage =
operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
XmlSchemaElement xmlSchemaElement = axisMessage.getSchemaElement();
if(xmlSchemaElement != null){
XmlSchemaType schemaType = xmlSchemaElement.getSchemaType();
if (schemaType instanceof XmlSchemaComplexType) {
XmlSchemaComplexType complexType = ((XmlSchemaComplexType)schemaType);
XmlSchemaParticle particle = complexType.getParticle();
if (particle instanceof XmlSchemaSequence || particle instanceof XmlSchemaAll) {
XmlSchemaGroupBase xmlSchemaGroupBase = (XmlSchemaGroupBase)particle;
Iterator iterator = xmlSchemaGroupBase.getItems().getIterator();
while (iterator.hasNext()) {
XmlSchemaElement innerElement = (XmlSchemaElement)iterator.next();
QName qName = innerElement.getQName();
if (qName == null && innerElement.getSchemaTypeName()
.equals(org.apache.ws.commons.schema.constants.Constants.XSD_ANYTYPE)) {
break;
}
long minOccurs = innerElement.getMinOccurs();
boolean nillable = innerElement.isNillable();
String name =
qName != null ? qName.getLocalPart() : innerElement.getName();
String type = innerElement.getSchemaTypeName().toString();
paramList.append(","+type +" " +name);
}
}
}
}
//remove first ","
String list = paramList.toString();
return list.replaceFirst(",", "");
}
示例6: handleAllCasesOfComplexTypes
import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
private boolean handleAllCasesOfComplexTypes(XmlSchemaType schemaType,
AxisMessage message,
List partNameList,
String qnameSuffix) throws CodeGenerationException {
// if a complex type name exits for a element then
// we keep that complex type to support unwrapping
if (schemaType instanceof XmlSchemaComplexType) {
XmlSchemaComplexType cmplxType = (XmlSchemaComplexType) schemaType;
XmlSchemaObjectCollection xmlObjectCollection = cmplxType.getAttributes();
if (xmlObjectCollection.getCount() != 0)
return false;
if (cmplxType.getContentModel() == null) {
if (cmplxType.getParticle() != null) {
return processXMLSchemaSequence(cmplxType.getParticle(), message, partNameList,
qnameSuffix);
}
} else {
// now lets handle case with extensions
return processComplexContentModel(cmplxType, message, partNameList, qnameSuffix);
}
// handle attributes here
// processAttributes(cmplxType, message, partNameList, qnameSuffix);
}
return false;
}
示例7: processComplexType
import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
private BeanWriterMetaInfoHolder processComplexType(
QName parentElementQName,
XmlSchemaComplexType complexType,
XmlSchema parentSchema) throws SchemaCompilationException {
XmlSchemaParticle particle = complexType.getParticle();
BeanWriterMetaInfoHolder metaInfHolder = new BeanWriterMetaInfoHolder();
if (particle != null) {
//Process the particle
processParticle(parentElementQName, particle, metaInfHolder, parentSchema);
}
//process attributes - first look for the explicit attributes
processAttributes(complexType.getAttributes(),metaInfHolder,parentSchema);
//process any attribute
//somehow the xml schema parser does not seem to pickup the any attribute!!
XmlSchemaAnyAttribute anyAtt = complexType.getAnyAttribute();
if (anyAtt != null) {
processAnyAttribute(metaInfHolder, anyAtt);
}
//process content ,either complex or simple
if (complexType.getContentModel() != null) {
processContentModel(complexType.getContentModel(),
metaInfHolder,
parentSchema);
}
return metaInfHolder;
}
示例8: hasResultRowName
import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
private static boolean hasResultRowName(XmlSchemaComplexType wrapperSchemaComplexType) {
XmlSchemaParticle wrapperSchemaParticle = wrapperSchemaComplexType.getParticle();
// a single sequence must be there
if (!(wrapperSchemaParticle instanceof XmlSchemaSequence)) {
return false;
}
XmlSchemaSequence wrapperSchemaSequence = (XmlSchemaSequence) wrapperSchemaParticle;
XmlSchemaObjectCollection objects = wrapperSchemaSequence.getItems();
if (objects.getCount() != 1) {
return false;
}
XmlSchemaObject schemaObject = objects.getItem(0);
if (!(schemaObject instanceof XmlSchemaElement)) {
return false;
}
XmlSchemaElement schemaElement = (XmlSchemaElement) schemaObject;
if (!((((XmlSchemaComplexType) schemaElement.getSchemaType())
.getParticle()) instanceof XmlSchemaSequence)) {
return false;
}
// cannot contain any attributes
if (wrapperSchemaComplexType.getAttributes().getCount() > 0) {
return false;
}
return true;
}
示例9: extractParticleWithRestriction
import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
/**
* Extract a particle from a complex type
* returns null if it can't be extracted.
*/
private XmlSchemaParticle extractParticleWithRestriction(XmlSchemaComplexType complexType) {
XmlSchemaParticle particle = complexType.getParticle();
if (particle == null && complexType.getContentModel() != null
&& complexType.getContentModel().getContent() != null) {
XmlSchemaContent content = complexType.getContentModel().getContent();
if (content instanceof XmlSchemaComplexContentRestriction) {
XmlSchemaComplexContentRestriction complexContent = (XmlSchemaComplexContentRestriction) content;
particle = complexContent.getParticle();
}
}
return particle;
}
示例10: merge
import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
private static void merge(XmlSchema schema, XmlSchemaComplexType first, XmlSchemaComplexType second) {
// check if the type is dynamic and can be merged
if (SchemaMeta.isDynamic(first)) {
// merge attributes
mergeAttributes(schema, first.getAttributes(), second.getAttributes());
// merge sequence of xsd:element if any
XmlSchemaSequence firstSequence = (XmlSchemaSequence) first.getParticle();
XmlSchemaSequence secondSequence = (XmlSchemaSequence) second.getParticle();
if (firstSequence != null || secondSequence != null) {
// create missing sequence
if (firstSequence == null) {
firstSequence = XmlSchemaUtils.makeDynamic(SchemaMeta.getReferencedDatabaseObjects(first), new XmlSchemaSequence());
first.setParticle(firstSequence);
} else if (secondSequence == null) {
secondSequence = XmlSchemaUtils.makeDynamic(SchemaMeta.getReferencedDatabaseObjects(second), new XmlSchemaSequence());
}
// merge sequence
mergeParticules(schema, firstSequence, secondSequence);
} else {
// suppose the type contains an extension
XmlSchemaSimpleContent firstContent = (XmlSchemaSimpleContent) first.getContentModel();
XmlSchemaSimpleContent secondContent = (XmlSchemaSimpleContent) second.getContentModel();
if (firstContent != null && secondContent != null) {
SchemaMeta.adoptReferences(schema, firstContent, secondContent);
XmlSchemaSimpleContentExtension firstContentExtension = (XmlSchemaSimpleContentExtension) firstContent.getContent();
XmlSchemaSimpleContentExtension secondContentExtension = (XmlSchemaSimpleContentExtension) secondContent.getContent();
mergeAttributes(schema, firstContentExtension.getAttributes(), secondContentExtension.getAttributes());
SchemaMeta.adoptReferences(schema, firstContentExtension, secondContentExtension);
}
}
}
SchemaMeta.adoptReferences(schema, first, second);
}