当前位置: 首页>>代码示例>>Java>>正文


Java XmlSchemaParticle类代码示例

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


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

示例1: cosnoamb

import org.apache.ws.commons.schema.XmlSchemaParticle; //导入依赖的package包/类
private static XmlSchemaGroupBase cosnoamb(XmlSchema xmlSchema, XmlSchemaGroupBase xmlParentSchemaGroupBase, XmlSchemaGroupBase xmlSchemaGroupBase) {
	System.out.println(" [email protected]"+xmlSchemaGroupBase.hashCode());
	List<XmlSchemaParticle> items = new XmlSchemaUtils.XmlSchemaObjectCollectionList<XmlSchemaParticle>(xmlSchemaGroupBase.getItems());
	int size = items.size();
	int i = 0, j = 1;
	
	if (size > 1 ) {
		while (i < size) {
			XmlSchemaParticle item1 = cosnoamb(xmlSchema, xmlSchemaGroupBase, items.get(i));
			while (j <= size-1) {
				XmlSchemaParticle item2 = cosnoamb(xmlSchema, xmlSchemaGroupBase, items.get(j));
				if (compare(xmlSchema, xmlSchemaGroupBase, item1, item2) == 0) {
					items = new XmlSchemaUtils.XmlSchemaObjectCollectionList<XmlSchemaParticle>(xmlSchemaGroupBase.getItems());
					size = items.size();
					item1 = items.get(j-1);
				}
				else {
					j++;
					break;
				}
			}
			i++;
		}
	}
	return xmlSchemaGroupBase;
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:27,代码来源:SchemaManager.java

示例2: getFirstElement

import org.apache.ws.commons.schema.XmlSchemaParticle; //导入依赖的package包/类
private static Map<XmlSchemaElement, XmlSchemaGroupBase> getFirstElement(XmlSchemaGroupBase parentSchemaGroupBase, XmlSchemaParticle particle) {
	Map<XmlSchemaElement, XmlSchemaGroupBase> map = new HashMap<XmlSchemaElement, XmlSchemaGroupBase>();
	if (particle instanceof XmlSchemaElement) {
		map.put((XmlSchemaElement)particle, parentSchemaGroupBase);
	}
	else if (particle instanceof XmlSchemaGroupBase) {
		XmlSchemaGroupBase xmlSchemaGroupBase = (XmlSchemaGroupBase)particle;
		List<XmlSchemaParticle> items = new XmlSchemaUtils.XmlSchemaObjectCollectionList<XmlSchemaParticle>(xmlSchemaGroupBase.getItems());
		if (items.size() > 0) {
			if (items.get(0) instanceof XmlSchemaElement) {
				map.put((XmlSchemaElement)items.get(0), xmlSchemaGroupBase);
			}
			else {
				map = getFirstElement(xmlSchemaGroupBase, items.get(0));
			}
		}
	}
	return map;
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:20,代码来源:SchemaManager.java

示例3: getXmlSchemaObject

import org.apache.ws.commons.schema.XmlSchemaParticle; //导入依赖的package包/类
@Override
public XmlSchemaParticle getXmlSchemaObject(XmlSchemaCollection collection, XmlSchema schema) {
	List<RequestableVariable> variables = getParentSequence().getAllVariables();
	
	XmlSchemaSequence sequence = variables.size() > 0 ? XmlSchemaUtils.makeDynamic(this, new XmlSchemaSequence()) : null;
	
	for (RequestableVariable variable : variables) {
		XmlSchemaElement element = XmlSchemaUtils.makeDynamic(this, new XmlSchemaElement());
		element.setName(variable.getName());
		element.setSchemaTypeName(variable.getTypeAffectation());
		element.setMinOccurs(0);
		if (variable.isMultiValued()) {
			element.setMaxOccurs(Long.MAX_VALUE);
		}
		sequence.getItems().add(element);
	}
	
	if (sequence != null) {
		return getXmlSchemaParticle(collection, schema, sequence);
	} else {
		return (XmlSchemaParticle) super.getXmlSchemaObject(collection, schema);
	}
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:24,代码来源:InputVariablesStep.java

示例4: extractParticle

import org.apache.ws.commons.schema.XmlSchemaParticle; //导入依赖的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;
}
 
开发者ID:inbloom,项目名称:secure-data-service,代码行数:20,代码来源:DidSchemaParser.java

示例5: parseParticleForIdentityType

import org.apache.ws.commons.schema.XmlSchemaParticle; //导入依赖的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

示例6: decorateImage

import org.apache.ws.commons.schema.XmlSchemaParticle; //导入依赖的package包/类
public Image decorateImage(Image image, Object element) {
	Image decoratedImage = image;
	
	if (element == null) {
		decoratedImage = null;
	} else if (element instanceof XmlSchemaParticle) {
		XmlSchemaParticle particle = (XmlSchemaParticle) element;
		
		long min = particle.getMinOccurs();
		long max = particle.getMaxOccurs();
		
		String occur = null;
		if (min == 0) {
			occur = "zero";
			if (max > 0) {
				occur += "_" + (max == 1 ? "one" : max == Long.MAX_VALUE ? "unbounded" : "n");
			}
		} else if (min == 1) {
			if (max > 1) {
				occur = "one_" + (max == Long.MAX_VALUE ? "unbounded" : "n");
			}
		} else {
			occur = "n";
			if (max > min) {
				occur += "_" + (max == Long.MAX_VALUE ? "unbounded" : "m");
			}
		}
		if (occur != null) {
			decoratedImage = getOverlayImageOccur(decoratedImage, element, occur);
		}			
	} else if (element instanceof XmlSchemaAttribute) {
		XmlSchemaAttribute attribute = (XmlSchemaAttribute) element;
		XmlSchemaUse use = attribute.getUse();
		if (use.equals(XmlSchemaUtils.attributeUseOptional)) {
			decoratedImage = getOverlayImageOccur(decoratedImage, element, "zero_one");
		}
	}
	
	return decoratedImage;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:41,代码来源:SchemaViewLabelDecorator.java

示例7: getTypesListFromXsd

import org.apache.ws.commons.schema.XmlSchemaParticle; //导入依赖的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

示例8: walkComplexType

import org.apache.ws.commons.schema.XmlSchemaParticle; //导入依赖的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);
        }
	}
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:32,代码来源:XmlSchemaWalker.java

示例9: walkComplexContentExtension

import org.apache.ws.commons.schema.XmlSchemaParticle; //导入依赖的package包/类
protected void walkComplexContentExtension(XmlSchema xmlSchema, XmlSchemaComplexContentExtension obj) {
	walkAnnotated(xmlSchema, obj);
	QName baseTypeName = obj.getBaseTypeName();
	if ((baseTypeName != null) && deep) {
		walkByTypeName(xmlSchema, baseTypeName);
	}
	
	XmlSchemaParticle xmlSchemaParticle = obj.getParticle();
	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);
        }
	}
	
	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,代码行数:35,代码来源:XmlSchemaWalker.java

示例10: walkComplexContentRestriction

import org.apache.ws.commons.schema.XmlSchemaParticle; //导入依赖的package包/类
protected void walkComplexContentRestriction(XmlSchema xmlSchema, XmlSchemaComplexContentRestriction obj) {
	walkAnnotated(xmlSchema, obj);
	QName baseTypeName = obj.getBaseTypeName();
	if ((baseTypeName != null) && deep) {
		walkByTypeName(xmlSchema, baseTypeName);
	}
	
	XmlSchemaParticle xmlSchemaParticle = obj.getParticle();
	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);
        }
	}
	
	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,代码行数:35,代码来源:XmlSchemaWalker.java

示例11: getXmlSchemaParticle

import org.apache.ws.commons.schema.XmlSchemaParticle; //导入依赖的package包/类
protected XmlSchemaParticle getXmlSchemaParticle(XmlSchemaCollection collection, XmlSchema schema, XmlSchemaGroupBase group) {
	XmlSchemaElement element = (XmlSchemaElement) super.getXmlSchemaObject(collection, schema);
	XmlSchemaComplexType cType = XmlSchemaUtils.makeDynamic(this, new XmlSchemaComplexType(schema));
	SchemaMeta.setContainerXmlSchemaGroupBase(element, group);
	element.setType(cType);
	cType.setParticle(group);
	return element;
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:9,代码来源:InputVariablesStep.java

示例12: getXmlSchemaObject

import org.apache.ws.commons.schema.XmlSchemaParticle; //导入依赖的package包/类
@Override
public XmlSchemaParticle getXmlSchemaObject(XmlSchemaCollection collection, XmlSchema schema) {
	XmlSchemaParticle particle = super.getXmlSchemaObject(collection, schema);
	long max = Long.MAX_VALUE;
	try {
		max = Integer.parseInt(getCondition());
		if (max < 0) {
			max = 0;
		}
		XmlSchemaGroupBase group = SchemaMeta.getContainerXmlSchemaGroupBase(particle);
		group.setMaxOccurs(max);
	} catch (Exception e) { }
	return particle;
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:15,代码来源:IteratorStep.java

示例13: getXmlSchemaObject

import org.apache.ws.commons.schema.XmlSchemaParticle; //导入依赖的package包/类
@Override
public XmlSchemaParticle getXmlSchemaObject(XmlSchemaCollection collection, XmlSchema schema) {
	XmlSchemaElement element = (XmlSchemaElement) super.getXmlSchemaObject(collection, schema);
	String namespace = Project.getProjectTargetNamespace(projectName);
	String localpart = getRequestableName() + "ResponseType";
	element.setSchemaTypeName(new QName(namespace, localpart));
	return element;
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:9,代码来源:RequestableStep.java

示例14: getXmlSchemaParticle

import org.apache.ws.commons.schema.XmlSchemaParticle; //导入依赖的package包/类
protected XmlSchemaParticle getXmlSchemaParticle(XmlSchemaCollection collection, XmlSchema schema, XmlSchemaGroupBase group) {
	XmlSchemaParticle particle = group;
	if (isOutput()) {
		XmlSchemaElement element = (XmlSchemaElement) super.getXmlSchemaObject(collection, schema);
		XmlSchemaComplexType cType = XmlSchemaUtils.makeDynamic(this, new XmlSchemaComplexType(schema));
		SchemaMeta.setContainerXmlSchemaGroupBase(element, group);
		element.setType(cType);
		cType.setParticle(group);
		particle = element;
	}
	return particle;
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:13,代码来源:StepWithExpressions.java

示例15: getParameterListForOperation

import org.apache.ws.commons.schema.XmlSchemaParticle; //导入依赖的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(",", "");
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:41,代码来源:XMPPSender.java


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