private void addSimpleType(XmlSchema schema,String typeName){ XmlSchemaSimpleType type; type = new XmlSchemaSimpleType(schema); type.setName(typeName); schema.addType(type); } public XmlSchema read(Reader r, ValidationEventHandler veh) {
private void addSimpleType(XmlSchema schema,String typeName){ XmlSchemaSimpleType type; type = new XmlSchemaSimpleType(schema); type.setName(typeName); schema.addType(type); } public XmlSchema read(Reader r, ValidationEventHandler veh) {
private void addSimpleType(XmlSchema schema,String typeName){ XmlSchemaSimpleType type; type = new XmlSchemaSimpleType(schema); type.setName(typeName); schema.addType(type); } public XmlSchema read(Reader r, ValidationEventHandler veh) {
/** * Completes the schema compilation process by writing the * mappers and the classes in a batch if needed * * @throws SchemaCompilationException */ private void finalizeSchemaCompilation() throws SchemaCompilationException { //write the extension mapping class writer.writeExtensionMapper( processedTypeMetaInfoMap.values().toArray( new BeanWriterMetaInfoHolder[processedTypeMetaInfoMap.size()])); if (options.isWrapClasses()) { writer.writeBatch(); } // resets the changed types for (XmlSchemaComplexType xmlSchemaComplexType : changedComplexTypeSet) { xmlSchemaComplexType.setName(null); } for (XmlSchemaSimpleType xmlSchemaSimpleType : changedSimpleTypeSet) { xmlSchemaSimpleType.setName(null); } for (XmlSchemaElement xmlSchemaElement : changedElementSet) { xmlSchemaElement.setSchemaTypeName(null); } }
/** * Completes the schema compilation process by writing the * mappers and the classes in a batch if needed * * @throws SchemaCompilationException */ private void finalizeSchemaCompilation() throws SchemaCompilationException { //write the extension mapping class writer.writeExtensionMapper( processedTypeMetaInfoMap.values().toArray( new BeanWriterMetaInfoHolder[processedTypeMetaInfoMap.size()])); if (options.isWrapClasses()) { writer.writeBatch(); } // resets the changed types for (XmlSchemaComplexType xmlSchemaComplexType : changedComplexTypeSet) { xmlSchemaComplexType.setName(null); } for (XmlSchemaSimpleType xmlSchemaSimpleType : changedSimpleTypeSet) { xmlSchemaSimpleType.setName(null); } for (XmlSchemaElement xmlSchemaElement : changedElementSet) { xmlSchemaElement.setSchemaTypeName(null); } }
@Override public void writeSchema(XmlSchema root) { XmlSchemaSimpleType simple = new XmlSchemaSimpleType(root, true); simple.setName(getSchemaType().getLocalPart()); XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction(); restriction.setBaseTypeName(Constants.XSD_STRING); simple.setContent(restriction); Object[] constants = getTypeClass().getEnumConstants(); List<XmlSchemaFacet> facets = restriction.getFacets(); for (Object constant : constants) { XmlSchemaEnumerationFacet f = new XmlSchemaEnumerationFacet(); f.setValue(getValue(constant)); facets.add(f); } }
@Override public void writeSchema(XmlSchema root) { XmlSchemaSimpleType simple = new XmlSchemaSimpleType(root, true); simple.setName(getSchemaType().getLocalPart()); XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction(); restriction.setBaseTypeName(Constants.XSD_STRING); simple.setContent(restriction); Object[] constants = getTypeClass().getEnumConstants(); List<XmlSchemaFacet> facets = restriction.getFacets(); for (Object constant : constants) { XmlSchemaEnumerationFacet f = new XmlSchemaEnumerationFacet(); f.setValue(getValue(constant)); facets.add(f); } }
private XmlSchemaSimpleType duplicateXmlSchemaSimpleType(Scope newScope) { XmlSchemaSimpleType oldSimpleType = (XmlSchemaSimpleType) getSchemaType(); XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(schema, oldSimpleType.isTopLevel()); simpleType.setContent(oldSimpleType.getContent()); simpleType.setName(newScope.toString()); return simpleType; }
} else { fakeQname = qname; simpleType.setName(fakeQname.getLocalPart()); changedSimpleTypeSet.add(simpleType); simpleType.setSourceURI(fakeQname.getNamespaceURI());
} else { fakeQname = qname; simpleType.setName(fakeQname.getLocalPart()); changedSimpleTypeSet.add(simpleType); simpleType.setSourceURI(fakeQname.getNamespaceURI());
simpleType.setName(enumClass); XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction(); restriction.setBaseTypeName(Constants.XSD_STRING);
simpleType.setName(enumClass); XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction(); restriction.setBaseTypeName(Constants.XSD_STRING);
private void visitAnonBoundedString() { simpleType.setName(stringScopedName.toString()); XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction(); restriction.setBaseTypeName(Constants.XSD_STRING);
private void visitBoundedString() { simpleType.setName(stringScopedName.toString()); XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction(); restriction.setBaseTypeName(Constants.XSD_STRING);
fixedRestriction.getFacets().add(fixedTotalDigits); fixedRestriction.getFacets().add(fixedFractionDigits); fixedSimpleType.setName(mapper.mapToQName(scopedName)); fixedSimpleType.setContent(fixedRestriction);
enumSchemaSimpleType.setName(mapper.mapToQName(enumNameScope));