Java Code Examples for com.sun.xml.xsom.XSModelGroup#getChildren()

The following examples show how to use com.sun.xml.xsom.XSModelGroup#getChildren() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SoapProtocol.java    From jolie with GNU Lesser General Public License v2.1 6 votes vote down vote up
private void groupProcessing(
	Value value,
	XSElementDecl xsDecl,
	SOAPElement element,
	SOAPEnvelope envelope,
	boolean first,
	XSModelGroup modelGroup,
	XSSchemaSet sSet,
	String messageNamespace )
	throws SOAPException {

	XSParticle[] children = modelGroup.getChildren();
	XSTerm currTerm;
	for( XSParticle child : children ) {
		currTerm = child.getTerm();
		if( currTerm.isModelGroup() ) {
			groupProcessing( value, xsDecl, element, envelope, first, currTerm.asModelGroup(), sSet,
				messageNamespace );
		} else {
			termProcessing( value, element, envelope, first, currTerm, child.getMaxOccurs(), sSet,
				messageNamespace );
		}
	}
}
 
Example 2
Source File: XsdToJolieConverterImpl.java    From jolie with GNU Lesser General Public License v2.1 6 votes vote down vote up
private void groupProcessing( XSModelGroup modelGroup, XSParticle particle, TypeInlineDefinition jolieType )
	throws ConversionException {
	XSModelGroup.Compositor compositor = modelGroup.getCompositor();
	// We handle "all" and "sequence", but not "choice"
	if( compositor.equals( XSModelGroup.ALL ) || compositor.equals( XSModelGroup.SEQUENCE ) ) {
		if( compositor.equals( XSModelGroup.SEQUENCE ) ) {
			log( Level.WARNING, WARNING_SEQUENCE );
		}

		for( XSParticle currParticle : modelGroup.getChildren() ) {
			XSTerm currTerm = currParticle.getTerm();
			if( currTerm.isModelGroup() ) {
				groupProcessing( currTerm.asModelGroup(), particle, jolieType );
			} else {
				// Create the new complex type for root types
				navigateSubTypes( currParticle, jolieType );
			}
		}
	} else if( compositor.equals( XSModelGroup.CHOICE ) ) {
		throw new ConversionException( ERROR_CHOICE );
	}

}
 
Example 3
Source File: MultiplicityCounterNG.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public Multiplicity modelGroup(XSModelGroup group) {
	boolean isChoice = group.getCompositor() == XSModelGroup.CHOICE;

	Multiplicity r = null;

	for (XSParticle p : group.getChildren()) {
		Multiplicity m = particle(p);

		if (r == null) {
			r = m;
			continue;
		}
		if (isChoice) {
			r = Multiplicity.choice(r, m);
		} else {
			r = Multiplicity.group(r, m);
		}
	}
	if (r == null)
	{
		return ZERO;
	}
	return r;
}
 
Example 4
Source File: FindXSElementDeclVisitor.java    From jaxb2-basics with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void modelGroup(XSModelGroup group) {
	for (XSParticle child : group.getChildren()) {
		child.visit(this);
	}
}
 
Example 5
Source File: SimpleTypeVisitor.java    From hyperjaxb3 with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void modelGroup(XSModelGroup group) {
	for (XSParticle child : group.getChildren()) {
		child.visit(this);
	}
}
 
Example 6
Source File: XsdParser.java    From jumbune with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void traverseChilds(XSTerm rfTerm) {

		if (rfTerm.isModelGroupDecl()) {

			XSModelGroupDecl rfmodelGD = rfTerm.asModelGroupDecl();

			XSModelGroup rfmodelG = rfmodelGD.getModelGroup();
			XSParticle[] rfparrs = rfmodelG.getChildren();
			for (XSParticle rfpar : rfparrs) {
				XSTerm rfsterm = rfpar.getTerm();
				if (rfsterm.isElementDecl()) {
					XSComplexType rfcomp = rfsterm.asElementDecl().getType()
							.asComplexType();
					if (rfcomp != null) {
						traverseChilds(rfsterm);
					}

				} else {
					traverseChilds(rfsterm);
				}
			}
		} else if (rfTerm.isModelGroup()) {
			XSModelGroup rmodel = rfTerm.asModelGroup();
			XSParticle[] rparrs = rmodel.getChildren();
			for (XSParticle rpar : rparrs) {
				if (rpar != null) {
					XSTerm rterm = rpar.getTerm();
					if (rterm.isElementDecl()) {
						childelements.add(rterm.asElementDecl());
						XSComplexType rcomp = rterm.asElementDecl().getType()
								.asComplexType();
						if (rcomp != null) {
							traverseChilds(rterm);
						}
					} else {
						traverseChilds(rterm);
					}

				}
			}
		} else {
			XSComplexType rtcomp = rfTerm.asElementDecl().getType()
					.asComplexType();
			XSContentType rfxscont = rtcomp.getContentType();
			XSParticle rfparticle = rfxscont.asParticle();
			if (rfparticle != null) {
				XSTerm rsterm = rfparticle.getTerm();
				traverseChilds(rsterm);
			} else {
				childelements.add(rfTerm.asElementDecl());
			}
		}
	}
 
Example 7
Source File: CollectEnumerationValuesVisitor.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void modelGroup(XSModelGroup group) {
	for (XSParticle child : group.getChildren()) {
		child.visit(this);
	}
}
 
Example 8
Source File: CollectSimpleTypeNamesVisitor.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void modelGroup(XSModelGroup group) {
	for (XSParticle child : group.getChildren()) {
		child.visit(this);
	}
}
 
Example 9
Source File: SchemaWalker.java    From citygml4j with Apache License 2.0 4 votes vote down vote up
public void modelGroup(XSModelGroup group) {
	for (XSParticle p : group.getChildren())
		if (shouldWalk && visited.add(p))
			particle(p);
}