public short getContentType() { return complexTypeDefinition.getContentType(); }
public boolean canHaveLocalValue() { return this.element.getEnclosingCTDefinition().getContentType() != 0; }
public boolean isSimpleValued() { if (this.type.getTypeCategory() == 14) { return true; } if (this.type.getTypeCategory() == 13) { int contentType = ((XSComplexTypeDefinition) this.type) .getContentType(); return contentType == 1; } return false; }
private PrimitiveType getPrimitiveInterpretation( ValueReference propName, XSComplexTypeDefinition complexType ) { short contentType = complexType.getContentType(); if ( contentType == CONTENTTYPE_SIMPLE ) { return new PrimitiveType( complexType.getSimpleType() ); } if ( contentType == CONTENTTYPE_MIXED ) { return new PrimitiveType( STRING ); } if ( contentType == CONTENTTYPE_ELEMENT ) { String msg = "XPath '" + propName + "' refers to a complex type with complex content."; throw new IllegalArgumentException( msg ); } String msg = "XPath '" + propName + "' refers to an empty element type."; throw new IllegalArgumentException( msg ); }
/** * For the given complex type, check if its base type is the regular xsd type (xsd:anyType) * which can be ignored * @param baseType * @param t ComplexTypeDefinition * @return true:ignorable, false-otherwise(user defined base type) */ public boolean isBaseTypeIgnorable(XSTypeDefinition baseType, XSComplexTypeDefinition t) { boolean bool = false; //Check baseType is xsd:anyType if (baseType != null) { if (baseType.getNamespace() == Constants.NS_SCHEMA_XSD && baseType.getName().equals("anyType")) bool = true; //Ignore this baseType } if (XSComplexTypeDefinition.CONTENTTYPE_SIMPLE == t.getContentType()) { bool = true; //ComplexType has a simplecontent } return bool; }
List<PropertyDeclaration> getProperties( XSElementDeclaration elementDecl ) { List<PropertyDeclaration> properties = new ArrayList<PropertyDeclaration>(); XSComplexTypeDefinition complexType = (XSComplexTypeDefinition) elementDecl.getTypeDefinition(); switch ( complexType.getContentType() ) { case XSComplexTypeDefinition.CONTENTTYPE_MIXED: case XSComplexTypeDefinition.CONTENTTYPE_ELEMENT: { XSParticle particle = complexType.getParticle(); collectProperties( particle, properties ); break; } case XSComplexTypeDefinition.CONTENTTYPE_EMPTY: case XSComplexTypeDefinition.CONTENTTYPE_SIMPLE: { break; } default: { // cannot happen } } return properties; }
if (XSComplexTypeDefinition.CONTENTTYPE_SIMPLE == t.getContentType())
if (typeDef instanceof XSComplexTypeDefinition) { XSComplexTypeDefinition complexTypeDef = (XSComplexTypeDefinition)typeDef; if (!(complexTypeDef.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE)) { strValueOf$value = null;
protected void handleContent(XSTypeDefinition type, boolean nillable, Object actualValue, short valueType, ShortList itemValueType) { if (type == null || type.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE && ((XSComplexTypeDefinition) type).getContentType() != XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) { // the content must be simpleType content fStore.reportError( "cvc-id.3", new Object[] { fIdentityConstraint.getName(), fStore.getElementName()}); } fMatchedString = actualValue; matched(fMatchedString, valueType, itemValueType, nillable); } // handleContent(XSElementDecl, String)
private XSElementDeclaration determineModelGroupDefinedValueElement( XSComplexTypeDefinition typeDef ) { switch ( typeDef.getContentType() ) { case XSComplexTypeDefinition.CONTENTTYPE_ELEMENT: { LOG.trace( "CONTENTTYPE_ELEMENT" );
switch ( typeDef.getContentType() ) { case XSComplexTypeDefinition.CONTENTTYPE_ELEMENT: { final XSParticle particle = typeDef.getParticle(); final String msg = "Internal error. Unhandled ContentType: " + typeDef.getContentType(); throw new RuntimeException( msg );
boolean isSimple = jxstype.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE;
public static boolean checkComplexType(XSTypeDefinition td) { if (td.getTypeCategory() != XSTypeDefinition.COMPLEX_TYPE) { return false; } XSComplexTypeDefinition ctd = (XSComplexTypeDefinition) td; if (ctd.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_ELEMENT) { return true; } if ((td instanceof XSComplexTypeDecl) && ((XSComplexTypeDecl) td).getAbstract()) { return true; } if (TEXT_ELEMENTS_ARE_COMPLEX) { return true; } if (ctd.getAttributeUses() != null) { for (int i = 0; i < ctd.getAttributeUses().getLength(); i++) { XSSimpleTypeDefinition xsstd = ((XSAttributeUse) ctd.getAttributeUses().item(i)).getAttrDeclaration() .getTypeDefinition(); if ("ID".equals(xsstd.getName())) { continue; } return true; } } return false; }
public static XSElementDeclaration unwrapArrayType(XSTypeDefinition xst) { if (xst instanceof XSComplexTypeDefinition == false) return null; XSComplexTypeDefinition xc = (XSComplexTypeDefinition)xst; if (xc.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_EMPTY) return null; XSParticle xsp = xc.getParticle(); if (xsp == null) return null; XSTerm xsterm = xsp.getTerm(); if (xsterm instanceof XSModelGroup == false) return null; XSModelGroup xm = (XSModelGroup)xsterm; XSObjectList xo = xm.getParticles(); if (xo.getLength() != 1) return null; XSParticle xp = (XSParticle)xo.item(0); XSTerm term = xp.getTerm(); if ((xp.getMaxOccursUnbounded() || xp.getMaxOccurs() > 1) == false || term instanceof XSElementDeclaration == false) return null; return (XSElementDeclaration)term; }
if ( typeDef.getContentType() != CONTENTTYPE_EMPTY && typeDef.getContentType() != CONTENTTYPE_ELEMENT ) {
public static boolean checkEnumType(XSTypeDefinition td) { final XSSimpleTypeDefinition st; if (td.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) { XSComplexTypeDefinition ctd = (XSComplexTypeDefinition) td; if (ctd.getContentType() != XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) { return false; } if (ctd.getAttributeUses() != null) { for (int i = 0; i < ctd.getAttributeUses().getLength(); i++) { XSSimpleTypeDefinition xsstd = ((XSAttributeUse) ctd.getAttributeUses() .item(i)).getAttrDeclaration() .getTypeDefinition(); if ("ID".equals(xsstd.getName())) { continue; } return false; } } st = ctd.getSimpleType(); } else if (td.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) { st = (XSSimpleTypeDefinition) td; } else { return false; } return st.getLexicalEnumeration() != null && st.getLexicalEnumeration().getLength() != 0; }
if (ctd.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE || ctd.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_MIXED) { path += "/text()"; text = modelMgr.translatePath(element.getRoot(), path, NodeKind.text, element.getPathId(), getBaseType(ctd.getSimpleType()),
switch ( complexType.getContentType() ) { case XSComplexTypeDefinition.CONTENTTYPE_ELEMENT: { s += "element only";
/** * Copy PSVI properties from another psvi item. * * @param elem the source of element PSVI items */ public void setPSVI(ElementPSVI elem) { this.fDeclaration = elem.getElementDeclaration(); this.fNotation = elem.getNotation(); this.fValidationContext = elem.getValidationContext(); this.fTypeDecl = elem.getTypeDefinition(); this.fSchemaInformation = elem.getSchemaInformation(); this.fValidity = elem.getValidity(); this.fValidationAttempted = elem.getValidationAttempted(); this.fErrorCodes = elem.getErrorCodes(); this.fErrorMessages = elem.getErrorMessages(); if (fTypeDecl instanceof XSSimpleTypeDefinition || fTypeDecl instanceof XSComplexTypeDefinition && ((XSComplexTypeDefinition)fTypeDecl).getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) { this.fValue.copyFrom(elem.getSchemaValue()); } else { this.fValue.reset(); } this.fSpecified = elem.getIsSchemaSpecified(); this.fNil = elem.getNil(); this.fTypeAlternative = elem.getTypeAlternative(); this.fInheritedAttributes = elem.getInheritedAttributes(); this.fFailedAssertions = elem.getFailedAssertions(); }
} else { XSComplexTypeDefinition complexType = (XSComplexTypeDefinition) elem.getTypeDefinition(); if (complexType.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) { simpleType = complexType.getSimpleType();