@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; }
restriction.getFacets().add(new XmlSchemaEnumerationFacet(enumObj.toString(), false)); simpleType.setContent(restriction);
restriction.getFacets().add(new XmlSchemaEnumerationFacet(enumObj.toString(), false)); simpleType.setContent(restriction);
@Nonnull protected XmlSchemaType createNumberSchemaType(NumberResolvedType numberTypeDefinition, QName baseType) { final XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(schema, false); final XmlSchemaSimpleTypeRestriction content = new XmlSchemaSimpleTypeRestriction(); content.setBaseTypeName(baseType); if (numberTypeDefinition.getMinimum() != null) { final XmlSchemaMinInclusiveFacet minLength = new XmlSchemaMinInclusiveFacet(); minLength.setValue(numberTypeDefinition.getMinimum()); content.getFacets().add(minLength); } if (numberTypeDefinition.getMaximum() != null) { final XmlSchemaMaxInclusiveFacet maxLength = new XmlSchemaMaxInclusiveFacet(); maxLength.setValue(numberTypeDefinition.getMaximum()); content.getFacets().add(maxLength); } simpleType.setContent(content); return simpleType; }
@Nonnull protected XmlSchemaType createNumberSchemaType(NumberResolvedType numberTypeDefinition, QName baseType) { final XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(schema, false); final XmlSchemaSimpleTypeRestriction content = new XmlSchemaSimpleTypeRestriction(); content.setBaseTypeName(baseType); if (numberTypeDefinition.getMinimum() != null) { final XmlSchemaMinInclusiveFacet minLength = new XmlSchemaMinInclusiveFacet(); minLength.setValue(numberTypeDefinition.getMinimum()); content.getFacets().add(minLength); } if (numberTypeDefinition.getMaximum() != null) { final XmlSchemaMaxInclusiveFacet maxLength = new XmlSchemaMaxInclusiveFacet(); maxLength.setValue(numberTypeDefinition.getMaximum()); content.getFacets().add(maxLength); } simpleType.setContent(content); return simpleType; }
maxLengthFacet.setValue(boundNode.toString()); restriction.getFacets().add(maxLengthFacet); simpleType.setContent(restriction);
simpleType.setContent(content); return simpleType;
simpleType.setContent(content); return simpleType;
maxLengthFacet.setValue(boundNode.toString()); restriction.getFacets().add(maxLengthFacet); simpleType.setContent(restriction);
fixedRestriction.getFacets().add(fixedFractionDigits); fixedSimpleType.setName(mapper.mapToQName(scopedName)); fixedSimpleType.setContent(fixedRestriction);
enumSchemaSimpleType.setContent(enumSchemaSimpleTypeRestriction);
XmlSchemaSimpleType stype = (XmlSchemaSimpleType)type; list.setItemTypeName(stype.getQName()); simpleType.setContent(list); part.setXmlSchema(simpleType); if (part.getConcreteName() == null) {