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


Java XSComplexType类代码示例

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


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

示例1: validateIsFaultType

import com.sun.xml.xsom.XSComplexType; //导入依赖的package包/类
public static boolean validateIsFaultType(NamespaceType namespace, SchemaElementType type, File baseSchemaDir)
    throws Exception {
    XSOMParser parser = new XSOMParser();
    parser.setErrorHandler(new DefaultErrorHandler());

    parser.parse(new File(baseSchemaDir.getAbsolutePath() + File.separator + namespace.getLocation()));

    XSSchemaSet sset = parser.getResult();
    XSComplexType bfct = sset.getComplexType(IntroduceConstants.BASEFAULTS_NAMESPACE, "BaseFaultType");
    XSElementDecl ct = sset.getElementDecl(namespace.getNamespace(), type.getType());
    if (ct.getType().isDerivedFrom(bfct)) {
        return true;
    } else {
        return false;
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:17,代码来源:MethodViewer.java

示例2: isSubstitutable

import com.sun.xml.xsom.XSComplexType; //导入依赖的package包/类
/**
 * Implements
 * <code>Validation Rule: Schema-Validity Assessment (Element) 1.2.1.2.4</code> 
 */
private static boolean isSubstitutable( XSType _base, XSType derived ) {
    // too ugly to the point that it's almost unbearable.
    // I mean, it's not even transitive. Thus we end up calling this method
    // for each candidate
    if( _base.isComplexType() ) {
        XSComplexType base = _base.asComplexType();
        
        for( ; base!=derived; derived=derived.getBaseType() ) {
            if( base.isSubstitutionProhibited( derived.getDerivationMethod() ) )
                return false;    // Type Derivation OK (Complex)-1
        }
        return true;
    } else {
        // simple type don't have any @block
        return true;
    }
}
 
开发者ID:jolie,项目名称:jolie,代码行数:22,代码来源:Util.java

示例3: iterateAttributeUses

import com.sun.xml.xsom.XSComplexType; //导入依赖的package包/类
public Iterator<XSAttributeUse> iterateAttributeUses() {
    
    XSComplexType baseType = getBaseType().asComplexType();
    
    if( baseType==null )    return super.iterateAttributeUses();
    
    return new Iterators.Union<XSAttributeUse>(
        new Iterators.Filter<XSAttributeUse>(baseType.iterateAttributeUses()) {
            protected boolean matches(XSAttributeUse value) {
                XSAttributeDecl u = value.getDecl();
                UName n = new UName(u.getTargetNamespace(),u.getName());
                return !prohibitedAtts.contains(n);
            }
        },
        super.iterateAttributeUses() );
}
 
开发者ID:jolie,项目名称:jolie,代码行数:17,代码来源:ComplexTypeImpl.java

示例4: findModelGroups

import com.sun.xml.xsom.XSComplexType; //导入依赖的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();
	}
}
 
开发者ID:mklemm,项目名称:jaxb2-rich-contract-plugin,代码行数:19,代码来源:GroupInterfaceGenerator.java

示例5: addSchemaElements

import com.sun.xml.xsom.XSComplexType; //导入依赖的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);
					}
				}
			}
		}
	}
}
 
开发者ID:impactcentre,项目名称:iif-generic-soap-client,代码行数:21,代码来源:WsdlDocument.java

示例6: isMultiValued

import com.sun.xml.xsom.XSComplexType; //导入依赖的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;
}
 
开发者ID:impactcentre,项目名称:iif-generic-soap-client,代码行数:33,代码来源:WsdlDocument.java

示例7: createComplexTypeDefinition

import com.sun.xml.xsom.XSComplexType; //导入依赖的package包/类
@Override
public ComplexTypeDefinition createComplexTypeDefinition(XSComplexType complexType,
		PrismContext prismContext, XSAnnotation annotation) throws SchemaException {
	if (isResourceObject(annotation)) {
		return createObjectClassDefinition(complexType, prismContext, annotation);
	}
	return super.createComplexTypeDefinition(complexType, prismContext, annotation);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:9,代码来源:MidPointSchemaDefinitionFactory.java

示例8: finishComplexTypeDefinition

import com.sun.xml.xsom.XSComplexType; //导入依赖的package包/类
@Override
public void finishComplexTypeDefinition(ComplexTypeDefinition complexTypeDefinition, XSComplexType complexType,
		PrismContext prismContext, XSAnnotation annotation) throws SchemaException {
	super.finishComplexTypeDefinition(complexTypeDefinition, complexType, prismContext, annotation);
	if (complexTypeDefinition instanceof ObjectClassComplexTypeDefinition) {
		// TODO is this safe?
		finishObjectClassDefinition((ObjectClassComplexTypeDefinitionImpl)complexTypeDefinition, complexType, prismContext, annotation);
	}
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:10,代码来源:MidPointSchemaDefinitionFactory.java

示例9: finishObjectClassDefinition

import com.sun.xml.xsom.XSComplexType; //导入依赖的package包/类
private void finishObjectClassDefinition(ObjectClassComplexTypeDefinitionImpl ocDef,
		XSComplexType complexType, PrismContext prismContext, XSAnnotation annotation) throws SchemaException {
	
	// displayNameAttribute
	ResourceAttributeDefinition attrDefinition = getAnnotationReference(annotation, MidPointConstants.RA_DISPLAY_NAME_ATTRIBUTE, ocDef);
	if (attrDefinition != null) {
		ocDef.setDisplayNameAttribute(attrDefinition);
	}
	// namingAttribute
	attrDefinition = getAnnotationReference(annotation, MidPointConstants.RA_NAMING_ATTRIBUTE, ocDef);
	if (attrDefinition != null) {
		ocDef.setNamingAttribute(attrDefinition);
	}
	// descriptionAttribute
	attrDefinition = getAnnotationReference(annotation, MidPointConstants.RA_DESCRIPTION_ATTRIBUTE, ocDef);
	if (attrDefinition != null) {
		ocDef.setDescriptionAttribute(attrDefinition);
	}
	// identifier
	attrDefinition = getAnnotationReference(annotation, MidPointConstants.RA_IDENTIFIER, ocDef);
	if (attrDefinition != null) {
		((Collection)ocDef.getPrimaryIdentifiers()).add(attrDefinition);
	}
	// secondaryIdentifier
	attrDefinition = getAnnotationReference(annotation, MidPointConstants.RA_SECONDARY_IDENTIFIER, ocDef);
	if (attrDefinition != null) {
		((Collection)ocDef.getSecondaryIdentifiers()).add(attrDefinition);
	}
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:30,代码来源:MidPointSchemaDefinitionFactory.java

示例10: createExtraDefinitionFromComplexType

import com.sun.xml.xsom.XSComplexType; //导入依赖的package包/类
@Override
	public <C extends Containerable> PrismContainerDefinition<C> createExtraDefinitionFromComplexType(XSComplexType complexType,
			ComplexTypeDefinition complexTypeDefinition, PrismContext prismContext, XSAnnotation annotation) throws SchemaException {		
//		if (complexTypeDefinition instanceof ObjectClassComplexTypeDefinition) {
//			return createResourceAttributeContainerDefinition(complexType, (ObjectClassComplexTypeDefinition)complexTypeDefinition, 
//					prismContext, annotation);
//		}
		
		return super.createExtraDefinitionFromComplexType(complexType, complexTypeDefinition, prismContext, annotation);
	}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:11,代码来源:MidPointSchemaDefinitionFactory.java

示例11: _valueToDocument

import com.sun.xml.xsom.XSComplexType; //导入依赖的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 );
			}
		}
	}
}
 
开发者ID:jolie,项目名称:jolie,代码行数:38,代码来源:XmlUtils.java

示例12: loadComplexType

import com.sun.xml.xsom.XSComplexType; //导入依赖的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;


}
 
开发者ID:jolie,项目名称:jolie,代码行数:39,代码来源:XsdToJolieConverterImpl.java

示例13: createAnyOrUndefined

import com.sun.xml.xsom.XSComplexType; //导入依赖的package包/类
private TypeInlineDefinition createAnyOrUndefined( String typeName, XSComplexType complexType )
{
	TypeInlineDefinition jolieType = new TypeInlineDefinition( parsingContext, typeName, NativeType.ANY, Constants.RANGE_ONE_TO_ONE );
	if ( !complexType.isMixed() ) {
		jolieType.setUntypedSubTypes( true );
	}
	return jolieType;
}
 
开发者ID:jolie,项目名称:jolie,代码行数:9,代码来源:XsdToJolieConverterImpl.java

示例14: createComplexType

import com.sun.xml.xsom.XSComplexType; //导入依赖的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 ) );
	}
}
 
开发者ID:jolie,项目名称:jolie,代码行数:9,代码来源:XsdToJolieConverterImpl.java

示例15: iterateComplexTypes

import com.sun.xml.xsom.XSComplexType; //导入依赖的package包/类
public Iterator<XSComplexType> iterateComplexTypes() {
    return new Iterators.Map<XSComplexType,XSSchema>(iterateSchema()) {
        protected Iterator<XSComplexType> apply(XSSchema u) {
            return u.iterateComplexTypes();
        }
    };
}
 
开发者ID:jolie,项目名称:jolie,代码行数:8,代码来源:SchemaSetImpl.java


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