}
private void processPSVIFacets(XSSimpleTypeDefinition type) {
if (type == null)
return;
XSObjectList facets = type.getFacets();
XSObjectList multiValueFacets = type.getMultiValueFacets();
if ((facets == null || facets.getLength() == 0)
&& (multiValueFacets == null || multiValueFacets.getLength() == 0)) {
sendElementEvent("psv:facets");
}
else {
sendIndentedElement("psv:facets");
if (facets != null) {
for (int i = 0; i < facets.getLength(); i++) {
XSFacet facet = (XSFacet)facets.item(i);
String name = this.translateFacetKind(facet.getFacetKind());
sendIndentedElement("psv:" + name);
sendElementEvent("psv:value", facet.getLexicalFacetValue());
sendElementEvent(
"psv:fixed",
String.valueOf(facet.getFixed()));
processPSVIAnnotation(facet.getAnnotation());
sendUnIndentedElement("psv:" + name);
}
}
if (multiValueFacets != null) {
for (int i = 0; i < multiValueFacets.getLength(); i++) {
XSMultiValueFacet facet =
(XSMultiValueFacet)multiValueFacets.item(i);
String name = this.translateFacetKind(facet.getFacetKind());
sendIndentedElement("psv:" + name);
StringList values = facet.getLexicalFacetValues();
for (int j = 0; j < values.getLength(); j++) {
sendElementEvent("psv:value", values.item(j));