Facet[] facets = os.getFacets(names[i]);
if (facets != null) {
for (int j = 0; j < facets.length; j++) {
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;