private boolean allowsXLink( XSComplexTypeDefinition typeDef ) { XSObjectList xsObjectList = typeDef.getAttributeUses(); for ( int i = 0; i < xsObjectList.getLength(); i++ ) { XSAttributeDeclaration attr = ( (XSAttributeUse) xsObjectList.item( i ) ).getAttrDeclaration(); if ( "href".equals( attr.getName() ) && XLNNS.equals( attr.getNamespace() ) ) { return true; } } return false; }
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; }
for ( int i = 0; i < xsdValueType.getAttributeUses().getLength(); i++ ) { XSAttributeDeclaration attrDecl = ( (XSAttributeUse) xsdValueType.getAttributeUses().item( i ) ).getAttrDeclaration(); QName name = new QName( attrDecl.getNamespace(), attrDecl.getName() ); attrDecls.put( name, attrDecl ); for ( int i = 0; i < xsdValueType.getAttributeUses().getLength(); i++ ) { XSAttributeUse attrUse = (XSAttributeUse) xsdValueType.getAttributeUses().item( i ); if ( attrUse.getRequired() ) { XSAttributeDeclaration attrDecl = attrUse.getAttrDeclaration();
private List<Schema.Field> createFields(XSComplexTypeDefinition type) { final Map<String, Schema.Field> fields = new LinkedHashMap<>(); XSObjectList attrUses = type.getAttributeUses(); for (int i = 0; i < attrUses.getLength(); i++) { XSAttributeUse attrUse = (XSAttributeUse) attrUses.item(i); XSAttributeDeclaration attrDecl = attrUse.getAttrDeclaration(); boolean optional = !attrUse.getRequired(); Schema.Field field = createField(fields.values(), attrDecl, attrDecl.getTypeDefinition(), optional, false); fields.put(field.getProp(Source.SOURCE), field); } XSParticle particle = type.getParticle(); if (particle == null) return new ArrayList<>(fields.values()); XSTerm term = particle.getTerm(); if (term.getType() != XSConstants.MODEL_GROUP) throw new ConverterException("Unsupported term type " + term.getType()); XSModelGroup group = (XSModelGroup) term; createGroupFields(group, fields, false); return new ArrayList<>(fields.values()); }
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; }
XSComplexTypeDefinition xsdValueType = (XSComplexTypeDefinition) elDecl.getTypeDefinition(); attrDecls = new HashMap<QName, XSAttributeDeclaration>(); for ( int i = 0; i < xsdValueType.getAttributeUses().getLength(); i++ ) { XSAttributeDeclaration attrDecl = ( (XSAttributeUse) xsdValueType.getAttributeUses().item( i ) ).getAttrDeclaration(); QName name = new QName( attrDecl.getNamespace(), attrDecl.getName() ); attrDecls.put( name, attrDecl ); for ( int i = 0; i < xsdValueType.getAttributeUses().getLength(); i++ ) { XSAttributeUse attrUse = (XSAttributeUse) xsdValueType.getAttributeUses().item( i ); if ( attrUse.getRequired() ) { XSAttributeDeclaration attrDecl = attrUse.getAttrDeclaration();
appendComplexTypeDefinition(buf, jxstype); XSObjectList list = jxstype.getAttributeUses(); for (int i = 0; i < list.getLength(); i++)
XSObjectList attributes = complex.getAttributeUses(); for ( int i = 0; i < attributes.getLength(); i++ ) { XSAttributeUse attribute = ( (XSAttributeUse) attributes.item( i ) );
XSObjectList attrList = xsComplexType.getAttributeUses(); for (int i = 0; i < attrList.getLength(); i++)
XSObjectList attrList = xsComplexType.getAttributeUses(); for (int i = 0; i < attrList.getLength(); i++)
XSObjectList attributeUses = typeDef.getAttributeUses(); for ( int i = 0; i < attributeUses.getLength(); i++ ) { XSAttributeUse attrUse = ( (XSAttributeUse) attributeUses.item( i ) );
if ( cm.getElementDecl().getTypeDefinition() instanceof XSComplexTypeDefinition ) { XSComplexTypeDefinition complexType = (XSComplexTypeDefinition) cm.getElementDecl().getTypeDefinition(); XSObjectList attrUses = complexType.getAttributeUses(); for ( int i = 0; i < attrUses.getLength(); i++ ) { XSAttributeUse attrUse = (XSAttributeUse) attrUses.item( i );
XSParticle particle = type.getParticle(); XSObjectList attributeUses = type.getAttributeUses(); int attrsTotal = declareNs || declareXsiType ? nsRegistry.size() + attributeUses.getLength() + 1 :
XSObjectList attrUses = complexTypeDef.getAttributeUses(); for ( int i = 0; i < attrUses.getLength(); i++ ) { XSAttributeUse attrUse = (XSAttributeUse) attrUses.item( i );
for (int i = 0; i < complexType.getAttributeUses().getLength(); i++) { stack.push(new StackItem(complexType.getAttributeUses().get(i), item));
XSObjectList attributeUses = typeDef.getAttributeUses(); for ( int i = 0; i < attributeUses.getLength(); i++ ) { XSAttributeUse attrUse = ( (XSAttributeUse) attributeUses.item( i ) );
td.fdMap.put(fd.name, fd); XSObjectList attrs = def.getAttributeUses(); for (int i = 0; i < attrs.getLength(); i++) { XSAttributeUse au = (XSAttributeUse) attrs.item(i);
XSObjectList xsAttrList = ctd.getAttributeUses(); for (int i = 0; i < xsAttrList.getLength(); i ++) { processAttribute(element, path, (XSAttributeUse) xsAttrList.item(i));
String toString( XSComplexTypeDefinition complexType ) { String s = "\n - complex type: '" + complexType.getName() + "' (" + complexType.getNamespace() + ")"; XSObjectList attributeUses = complexType.getAttributeUses(); for ( int i = 0; i < attributeUses.getLength(); i++ ) { XSAttributeUse attributeUse = (XSAttributeUse) attributeUses.item( i );
XSComplexTypeDefinition cmplxType = ((XSComplexTypeDefinition)sourceComponent); if (NO_FILTER == filter || XSConstants.ATTRIBUTE_USE == filter) { XSObjectList attributeUses = cmplxType.getAttributeUses(); for (int i = 0, n = attributeUses.size(); i < n; ++i) { addComponent(attributeUses.item(i), nameTest, targetComponents);