本文整理汇总了Java中com.sun.xml.xsom.XSParticle类的典型用法代码示例。如果您正苦于以下问题:Java XSParticle类的具体用法?Java XSParticle怎么用?Java XSParticle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XSParticle类属于com.sun.xml.xsom包,在下文中一共展示了XSParticle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: groupProcessing
import com.sun.xml.xsom.XSParticle; //导入依赖的package包/类
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 );
}
}
}
示例2: groupProcessing
import com.sun.xml.xsom.XSParticle; //导入依赖的package包/类
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 );
}
XSParticle[] children = modelGroup.getChildren();
XSTerm currTerm;
for( int i = 0; i < children.length; i++ ) {
currTerm = children[i].getTerm();
if ( currTerm.isModelGroup() ) {
groupProcessing( currTerm.asModelGroup(), particle, jolieType );
} else {
// Create the new complex type for root types
navigateSubTypes( children[i], jolieType );
}
}
} else if ( compositor.equals( XSModelGroup.CHOICE ) ) {
throw new ConversionException( ERROR_CHOICE );
}
}
示例3: findModelGroups
import com.sun.xml.xsom.XSParticle; //导入依赖的package包/类
private static Collection<? extends XSDeclaration> findModelGroups(final XSComplexType complexType) {
XSContentType contentType = complexType.getExplicitContent();
if (contentType == null) {
contentType = complexType.getContentType();
}
final XSParticle particle = contentType.asParticle();
if (particle != null && !particle.isRepeated()) {
final XSTerm term = particle.getTerm();
if (term instanceof XSModelGroupDecl) {
return Collections.singletonList((XSModelGroupDecl)term);
} else {
final XSModelGroup modelGroup = term.asModelGroup();
return modelGroup != null ? findModelGroups(modelGroup) : Collections.<XSModelGroupDecl>emptyList();
}
} else {
return Collections.emptyList();
}
}
示例4: setDocComment
import com.sun.xml.xsom.XSParticle; //导入依赖的package包/类
private static void setDocComment(FieldOutline fo, FieldInfo attrInfo) {
XSComponent xsComp = fo.getPropertyInfo().getSchemaComponent();
if (xsComp != null && xsComp instanceof XSParticle) {
XSParticle xsParticle = (XSParticle) xsComp;
XSTerm xsTerm = xsParticle.getTerm();
XSElementDecl elemndecl = xsTerm.asElementDecl();
if (elemndecl.getDefaultValue() != null) {
attrInfo.setValue(elemndecl.getDefaultValue().value);
attrInfo.setFixedValue(false);
} else if (elemndecl.getFixedValue() != null) {
attrInfo.setValue(elemndecl.getFixedValue().value);
attrInfo.setFixedValue(true);
}
String attrDoc = ModelBuilder.getDocumentation(xsTerm);
attrInfo.setDocComment(attrDoc);
}
}
示例5: modelGroup
import com.sun.xml.xsom.XSParticle; //导入依赖的package包/类
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;
}
示例6: particle
import com.sun.xml.xsom.XSParticle; //导入依赖的package包/类
@Override
public Multiplicity particle(XSParticle p) {
Multiplicity m = p.getTerm().apply(this.counter);
BigInteger max;
if (m.max == null
|| (BigInteger.valueOf(XSParticle.UNBOUNDED).equals(p
.getMaxOccurs())))
max = null;
else
max = p.getMaxOccurs();
return Multiplicity.multiply(m,
Multiplicity.create(p.getMinOccurs(), max));
}
示例7: addSchemaElements
import com.sun.xml.xsom.XSParticle; //导入依赖的package包/类
private void addSchemaElements() {
for (Map.Entry<String, XSComplexType> entry : schemaObject
.getComplexTypes().entrySet()) {
XSContentType content = entry.getValue().getContentType();
XSParticle particle = content.asParticle();
if (particle != null) {
XSTerm term = particle.getTerm();
if (term.isModelGroup()) {
XSParticle[] particles = term.asModelGroup().getChildren();
for (XSParticle p : particles) {
XSTerm pterm = p.getTerm();
if (pterm.isElementDecl()) {
XSElementDecl e = pterm.asElementDecl();
schemaElements.put(e.getName(), e);
}
}
}
}
}
}
示例8: isMultiValued
import com.sun.xml.xsom.XSParticle; //导入依赖的package包/类
/**
* Checks if "maxOccurs" of the element definition is greater than 1, i.e.,
* if the SOAP message can contain several values for one input
*
* @param inputName
* The element name
* @return
*/
public boolean isMultiValued(String inputName) {
for (Map.Entry<String, XSComplexType> entry : schemaObject
.getComplexTypes().entrySet()) {
XSContentType content = entry.getValue().getContentType();
XSParticle particle = content.asParticle();
if (particle != null) {
XSTerm term = particle.getTerm();
if (term.isModelGroup()) {
XSParticle[] particles = term.asModelGroup().getChildren();
for (XSParticle p : particles) {
XSTerm pterm = p.getTerm();
if (pterm.isElementDecl()) {
XSElementDecl e = pterm.asElementDecl();
if (e.getName().equals(inputName)) {
return p.isRepeated();
}
}
}
}
}
}
return false;
}
示例9: createPropertyDefinition
import com.sun.xml.xsom.XSParticle; //导入依赖的package包/类
@Override
public <T> PrismPropertyDefinition<T> createPropertyDefinition(QName elementName, QName typeName,
ComplexTypeDefinition complexTypeDefinition, PrismContext prismContext, XSAnnotation annotation,
XSParticle elementParticle) throws SchemaException {
if (complexTypeDefinition != null && complexTypeDefinition instanceof ObjectClassComplexTypeDefinition) {
return createResourceAttributeDefinition(elementName, typeName, prismContext, annotation);
}
return super.createPropertyDefinition(elementName, typeName, complexTypeDefinition, prismContext, annotation, elementParticle);
}
示例10: hasAnnotation
import com.sun.xml.xsom.XSParticle; //导入依赖的package包/类
public static BIDeclaration hasAnnotation(ClassOutline classOutline, JFieldVar field, QName qname) {
CPropertyInfo propertyInfo = classOutline.target.getProperty(field.name());
if (propertyInfo == null || !(propertyInfo.getSchemaComponent() instanceof XSParticle)) {
return null;
}
XSParticle particle = (XSParticle)propertyInfo.getSchemaComponent();
if (particle.getTerm() == null) {
return null;
}
XSAnnotation annotation = particle.getTerm().getAnnotation(false);
return hasAnnotation(annotation, qname);
}
示例11: termProcessing
import com.sun.xml.xsom.XSParticle; //导入依赖的package包/类
private void termProcessing( Value value, SOAPElement element, SOAPEnvelope envelope, boolean first,
XSTerm currTerm, int getMaxOccur,
XSSchemaSet sSet, String messageNamespace )
throws SOAPException
{
if ( currTerm.isElementDecl() ) {
ValueVector vec;
XSElementDecl currElementDecl = currTerm.asElementDecl();
String name = currElementDecl.getName();
String prefix = (first) ? getPrefix( currElementDecl ) : getPrefixOrNull( currElementDecl );
SOAPElement childElement;
if ( (vec = value.children().get( name )) != null ) {
int k = 0;
while( vec.size() > 0 && (getMaxOccur > k || getMaxOccur == XSParticle.UNBOUNDED) ) {
if ( prefix == null ) {
childElement = element.addChildElement( name );
} else {
childElement = element.addChildElement( name, prefix );
}
Value v = vec.remove( 0 );
valueToTypedSOAP(
v,
currElementDecl,
childElement,
envelope,
false,
sSet,
messageNamespace );
k++;
}
}
}
}
示例12: _valueToDocument
import com.sun.xml.xsom.XSParticle; //导入依赖的package包/类
private static void _valueToDocument( Value value, Element element, Document doc, XSType type )
{
if ( type.isSimpleType() ) {
element.appendChild( doc.createTextNode( value.strValue() ) );
} else if ( type.isComplexType() ) {
String name;
Value currValue;
XSComplexType complexType = type.asComplexType();
// Iterate over attributes
Collection< ? extends XSAttributeUse > attributeUses = complexType.getAttributeUses();
for( XSAttributeUse attrUse : attributeUses ) {
name = attrUse.getDecl().getName();
if ( (currValue=getAttributeOrNull( value, name )) != null ) {
element.setAttribute( name, currValue.strValue() );
}
}
XSContentType contentType = complexType.getContentType();
XSParticle particle = contentType.asParticle();
if ( contentType.asSimpleType() != null ) {
element.appendChild( doc.createTextNode( value.strValue() ) );
} else if ( particle != null ) {
XSTerm term = particle.getTerm();
XSModelGroupDecl modelGroupDecl;
XSModelGroup modelGroup = null;
if ( (modelGroupDecl=term.asModelGroupDecl()) != null ) {
modelGroup = modelGroupDecl.getModelGroup();
} else if ( term.isModelGroup() ) {
modelGroup = term.asModelGroup();
}
if ( modelGroup != null ) {
_valueToDocument( value, element, doc, modelGroup );
}
}
}
}
示例13: loadComplexType
import com.sun.xml.xsom.XSParticle; //导入依赖的package包/类
private TypeDefinition loadComplexType( XSComplexType complexType, boolean lazy, TypeDefinition lazyType )
throws ConversionException
{
XSParticle particle;
XSContentType contentType;
contentType = complexType.getContentType();
if ( (particle = contentType.asParticle()) == null ) {
return null;//createAnyOrUndefined( complexType.getName(), complexType );
}
TypeInlineDefinition jolieType;
if ( lazy ) {
jolieType = (TypeInlineDefinition) lazyType;
} else {
jolieType = createComplexType( complexType, complexType.getName().replace("-","_") + TYPE_SUFFIX, particle );
}
if ( contentType.asSimpleType() != null ) {
checkStrictModeForSimpleType( contentType );
} else if ( (particle = contentType.asParticle()) != null ) {
XSTerm term = particle.getTerm();
XSModelGroupDecl modelGroupDecl = null;
XSModelGroup modelGroup = null;
modelGroup = getModelGroup( modelGroupDecl, term );
if ( modelGroup != null ) {
groupProcessing( modelGroup, particle, jolieType );
}
}
return jolieType;
}
示例14: createComplexType
import com.sun.xml.xsom.XSParticle; //导入依赖的package包/类
private TypeInlineDefinition createComplexType( XSComplexType complexType, String typeName, XSParticle particle )
{
if ( complexType.isMixed() ) {
return new TypeInlineDefinition( parsingContext, typeName, NativeType.ANY, getRange( particle ) );
} else {
return new TypeInlineDefinition( parsingContext, typeName, NativeType.VOID, getRange( particle ) );
}
}
示例15: getRange
import com.sun.xml.xsom.XSParticle; //导入依赖的package包/类
private Range getRange( XSParticle part )
{
int min = 1;
int max = Integer.MAX_VALUE;
if ( part.getMinOccurs() != -1 ) {
min = part.getMinOccurs();
}
if ( part.getMaxOccurs() != -1 ) {
max = part.getMaxOccurs();
}
return new Range( min, max );
}