本文整理汇总了Java中org.apache.xerces.impl.dv.XSSimpleType类的典型用法代码示例。如果您正苦于以下问题:Java XSSimpleType类的具体用法?Java XSSimpleType怎么用?Java XSSimpleType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XSSimpleType类属于org.apache.xerces.impl.dv包,在下文中一共展示了XSSimpleType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSimpleTypesString
import org.apache.xerces.impl.dv.XSSimpleType; //导入依赖的package包/类
private static String getSimpleTypesString(XSTypeDefinition et) {
StringBuffer typesHierarchy = new StringBuffer();
while (et != null && !"anySimpleType".equals(et.getName()) && !"anyType".equals(et.getName()) && et.getNamespace() != null) {
typesHierarchy.append(et.getNamespace().substring(et.getNamespace().lastIndexOf("/") + 1))
.append(":")
.append(et.getName())
.append(";");
if (et instanceof XSSimpleType) {
XSSimpleType simpleType = (XSSimpleType) et;
if (simpleType.getVariety() == XSSimpleTypeDefinition.VARIETY_LIST
|| simpleType.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) {
XSObjectList list = simpleType.getMemberTypes();
if (list.getLength() > 0) {
typesHierarchy.append("{");
for (int i = 0; i < list.getLength(); i++) {
typesHierarchy.append(getSimpleTypesString((XSTypeDefinition) list.item(i)));
}
typesHierarchy.append("}");
}
}
}
et = et.getBaseType();
}
return typesHierarchy.toString();
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:26,代码来源:XSDModelLoader.java
示例2: getSimpleTypesString
import org.apache.xerces.impl.dv.XSSimpleType; //导入依赖的package包/类
private static String getSimpleTypesString(XSTypeDefinition et) {
StringBuffer typesHierarchy = new StringBuffer();
while (et != null && !"anySimpleType".equals(et.getName()) && !"anyType".equals(et.getName()) && et.getNamespace() != null) {
typesHierarchy.append(et.getNamespace().substring(et.getNamespace().lastIndexOf("/") + 1)).append(":").append(et.getName()).append(";");
if (et instanceof XSSimpleType) {
XSSimpleType simpleType = (XSSimpleType) et;
if (simpleType.getVariety() == XSSimpleTypeDefinition.VARIETY_LIST
|| simpleType.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) {
XSObjectList list = simpleType.getMemberTypes();
if (list.getLength() > 0) {
typesHierarchy.append("{");
for (int i = 0; i < list.getLength(); i++) {
typesHierarchy.append(getSimpleTypesString((XSTypeDefinition) list.item(i)));
}
typesHierarchy.append("}");
}
}
}
et = et.getBaseType();
}
return typesHierarchy.toString();
}
示例3: processAttributePSVI
import org.apache.xerces.impl.dv.XSSimpleType; //导入依赖的package包/类
/** Returns whether the given attribute is an ID type. **/
private boolean processAttributePSVI(AttrImpl attr, AttributePSVI attrPSVI) {
if (fStorePSVI) {
((PSVIAttrNSImpl) attr).setPSVI (attrPSVI);
}
Object type = attrPSVI.getMemberTypeDefinition ();
if (type == null) {
type = attrPSVI.getTypeDefinition ();
if (type != null) {
attr.setType(type);
return ((XSSimpleType) type).isIDType();
}
}
else {
attr.setType(type);
return ((XSSimpleType) type).isIDType();
}
return false;
}
示例4: setNumeric
import org.apache.xerces.impl.dv.XSSimpleType; //导入依赖的package包/类
private void setNumeric(){
if(fVariety == VARIETY_ATOMIC){
this.fNumeric = fBase.fNumeric;
}
else if(fVariety == VARIETY_LIST){
this.fNumeric = false;
}
else if(fVariety == VARIETY_UNION){
XSSimpleType[] memberTypes = fMemberTypes;
for(int i = 0 ; i < memberTypes.length ; i++){
if(!memberTypes[i].getNumeric() ){
this.fNumeric = false;
return;
}
}
this.fNumeric = true;
}
}
示例5: createBuiltInTypes
import org.apache.xerces.impl.dv.XSSimpleType; //导入依赖的package包/类
static void createBuiltInTypes() {
final String ANYATOMICTYPE = "anyAtomicType";
final String DURATION = "duration";
final String YEARMONTHDURATION = "yearMonthDuration";
final String DAYTIMEDURATION = "dayTimeDuration";
createBuiltInTypes(fBuiltInTypes, XSSimpleTypeDecl.fAnyAtomicType);
// add anyAtomicType
fBuiltInTypes.put(ANYATOMICTYPE, XSSimpleTypeDecl.fAnyAtomicType);
// add 2 duration types
XSSimpleTypeDecl durationDV = (XSSimpleTypeDecl)fBuiltInTypes.get(DURATION);
fBuiltInTypes.put(YEARMONTHDURATION, new XSSimpleTypeDecl(durationDV, YEARMONTHDURATION, XSSimpleTypeDecl.DV_YEARMONTHDURATION, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSSimpleTypeDecl.YEARMONTHDURATION_DT));
fBuiltInTypes.put(DAYTIMEDURATION, new XSSimpleTypeDecl(durationDV, DAYTIMEDURATION, XSSimpleTypeDecl.DV_DAYTIMEDURATION, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSSimpleTypeDecl.DAYTIMEDURATION_DT));
}
示例6: errorType
import org.apache.xerces.impl.dv.XSSimpleType; //导入依赖的package包/类
private XSSimpleType errorType(String name, String namespace, short refType) {
XSSimpleType stringType = (XSSimpleType)SchemaGrammar.SG_SchemaNS.getTypeDefinition("string");
switch (refType) {
case XSConstants.DERIVATION_RESTRICTION:
return fSchemaHandler.fDVFactory.createTypeRestriction(name, namespace, (short)0,
stringType, null);
case XSConstants.DERIVATION_LIST:
return fSchemaHandler.fDVFactory.createTypeList(name, namespace, (short)0,
stringType, null);
case XSConstants.DERIVATION_UNION:
return fSchemaHandler.fDVFactory.createTypeUnion(name, namespace, (short)0,
new XSSimpleType[]{stringType}, null);
}
return null;
}
示例7: contentRestore
import org.apache.xerces.impl.dv.XSSimpleType; //导入依赖的package包/类
private void contentRestore() {
fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
int i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
fBlock = (short)(i >> 16);
fContentType = (short)i;
i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
fDerivedBy = (short)(i >> 16);
fFinal = (short)i;
fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
fName = (String)fGlobalStore[--fGlobalStorePos];
fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]).booleanValue();
fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}
示例8: containsQName
import org.apache.xerces.impl.dv.XSSimpleType; //导入依赖的package包/类
private boolean containsQName(XSSimpleType type) {
if (type.getVariety() == XSSimpleType.VARIETY_ATOMIC) {
short primitive = type.getPrimitiveKind();
return (primitive == XSSimpleType.PRIMITIVE_QNAME ||
primitive == XSSimpleType.PRIMITIVE_NOTATION);
}
else if (type.getVariety() == XSSimpleType.VARIETY_LIST) {
return containsQName((XSSimpleType)type.getItemType());
}
else if (type.getVariety() == XSSimpleType.VARIETY_UNION) {
XSObjectList members = type.getMemberTypes();
for (int i = 0; i < members.getLength(); i++) {
if (containsQName((XSSimpleType)members.item(i)))
return true;
}
}
return false;
}
示例9: checkSimpleDerivationOk
import org.apache.xerces.impl.dv.XSSimpleType; //导入依赖的package包/类
/**
* check whether simple type derived is valid derived from base,
* given a subset of {restriction, extension}.
*/
public static boolean checkSimpleDerivationOk(XSSimpleType derived, XSTypeDefinition base, short block) {
// if derived is anySimpleType, then it's valid only if the base
// is ur-type
if (derived == SchemaGrammar.fAnySimpleType) {
return (base == SchemaGrammar.fAnyType ||
base == SchemaGrammar.fAnySimpleType);
}
// if base is complex type
if (base.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
// if base is anyType, change base to anySimpleType,
// otherwise, not valid
if (base == SchemaGrammar.fAnyType)
base = SchemaGrammar.fAnySimpleType;
else
return false;
}
return checkSimpleDerivation((XSSimpleType)derived,
(XSSimpleType)base, block);
}
示例10: setValues
import org.apache.xerces.impl.dv.XSSimpleType; //导入依赖的package包/类
public void setValues(String name, String targetNamespace,
XSTypeDefinition baseType, short derivedBy, short schemaFinal,
short block, short contentType,
boolean isAbstract, XSAttributeGroupDecl attrGrp,
XSSimpleType simpleType, XSParticleDecl particle,
XSObjectListImpl annotations) {
fTargetNamespace = targetNamespace;
fBaseType = baseType;
fDerivedBy = derivedBy;
fFinal = schemaFinal;
fBlock = block;
fContentType = contentType;
if(isAbstract)
fMiscFlags |= CT_IS_ABSTRACT;
fAttrGrp = attrGrp;
fXSSimpleType = simpleType;
fParticle = particle;
fAnnotations = annotations;
}
示例11: printOrdered
import org.apache.xerces.impl.dv.XSSimpleType; //导入依赖的package包/类
void printOrdered (short ordered){
switch(ordered){
case XSSimpleType.ORDERED_FALSE:
System.err.println("'ordered' \t\t\t\t: false" );
break;
case XSSimpleType.ORDERED_PARTIAL:
System.err.println("'ordered' \t\t\t\t: partial" );
break;
case XSSimpleType.ORDERED_TOTAL:
System.err.println("'ordered' \t\t\t\t: total" );
break;
}
}
示例12: printVariety
import org.apache.xerces.impl.dv.XSSimpleType; //导入依赖的package包/类
void printVariety(short variety){
switch(variety){
case XSSimpleType.VARIETY_ATOMIC:
System.err.println("'variety' \t\t\t: ATOMIC");
break;
case XSSimpleType.VARIETY_LIST:
System.err.println("'variety' \t\t\t: LIST");
break;
case XSSimpleType.VARIETY_UNION:
System.err.println("'variety' \t\t\t: UNION");
break;
default:
System.err.println("Invalid value of 'Variety' property , it should be one of atomic, list or union.");
break;
}
}
示例13: main
import org.apache.xerces.impl.dv.XSSimpleType; //导入依赖的package包/类
public static void main(String [] args){
SimpleTypeUsage usage = new SimpleTypeUsage();
if(args.length == 1 ){
XSSimpleType builtInType = factory.getBuiltInType(args[0]);
if(builtInType == null){
System.err.println("Invalid built-in Simple datatype given as argument.");
printUsage();
}
else {
usage.querySimpleType(builtInType);
}
}else{
printUsage();
}
}
示例14: characters
import org.apache.xerces.impl.dv.XSSimpleType; //导入依赖的package包/类
@Override
public void characters(char[] ch, int start, int length) throws SAXException {
XSSimpleType simpleType=aligner.getElementType();
boolean numericType=false;
boolean booleanType=false;
if (simpleType!=null) {
if (DEBUG) log.debug("characters for SimpleType ["+new String(ch,start,length)+"]");
if (simpleType.getNumeric()) {
numericType=true;
}
if (simpleType.getBuiltInKind()==XSConstants.BOOLEAN_DT) {
booleanType=true;
}
}
documentContainer.characters(ch, start, length, numericType, booleanType);
super.characters(ch, start, length);
}
示例15: getNumericType
import org.apache.xerces.impl.dv.XSSimpleType; //导入依赖的package包/类
private static int getNumericType(RDFDatatype numeric)
{
XSSimpleType type = (XSSimpleType) numeric.extendedTypeDefinition();
if (type.derivedFromType(integerType, XSConstants.DERIVATION_EXTENSION))
return integerType.getBuiltInKind();
if (type.derivedFromType(decimalType, XSConstants.DERIVATION_EXTENSION))
return decimalType.getBuiltInKind();
if (type.derivedFromType(floatType, XSConstants.DERIVATION_EXTENSION))
return floatType.getBuiltInKind();
if (type.derivedFromType(doubleType, XSConstants.DERIVATION_EXTENSION))
return doubleType.getBuiltInKind();
throw new IllegalArgumentException();
}