Facet facet = facets[j];
if (facet instanceof DefaultValueFacet) {
DefaultValueFacet dvf = (DefaultValueFacet)facet;
defaultValue = dvf.getDefaultValue();
} else if (facet instanceof RegexFacet) {
RegexFacet rf = (RegexFacet)facet;
regex = rf.getRegex();
} else if (facet instanceof PermittedValuesFacet) {
PermittedValuesFacet pvf = (PermittedValuesFacet)facet;
pValues = pvf.getPermittedValuesAsString();
} else if (facet instanceof CardinalityFacet) {
CardinalityFacet cf = (CardinalityFacet)facet;