builder.setPrimaryItemName(resolver.getQName(ntdElement.getAttribute(PRIMARYITEMNAME_ATTRIBUTE)));
}
Element child = DomUtil.getChildElement(ntdElement, SUPERTYPES_ELEMENT, null);
if (child != null) {
ElementIterator stIter = DomUtil.getChildren(child, SUPERTYPE_ELEMENT, null);
List<Name> qNames = new ArrayList<Name>();
while (stIter.hasNext()) {
Name st = resolver.getQName(DomUtil.getTextTrim(stIter.nextElement()));
qNames.add(st);
}
builder.setSupertypes(qNames.toArray(new Name[qNames.size()]));
}
if (ntdElement.hasAttribute(ISMIXIN_ATTRIBUTE)) {
builder.setMixin(Boolean.valueOf(ntdElement.getAttribute(ISMIXIN_ATTRIBUTE)));
}
if (ntdElement.hasAttribute(HASORDERABLECHILDNODES_ATTRIBUTE)) {
builder.setOrderableChildNodes(Boolean.valueOf(ntdElement.getAttribute(HASORDERABLECHILDNODES_ATTRIBUTE)));
}
if (ntdElement.hasAttribute(ISABSTRACT_ATTRIBUTE)) {
builder.setAbstract(Boolean.valueOf(ntdElement.getAttribute(ISABSTRACT_ATTRIBUTE)));
}
if (ntdElement.hasAttribute(ISQUERYABLE_ATTRIBUTE)) {
builder.setQueryable(Boolean.valueOf(ntdElement.getAttribute(ISQUERYABLE_ATTRIBUTE)));
}
// nodeDefinitions
ElementIterator it = DomUtil.getChildren(ntdElement, CHILDNODEDEFINITION_ELEMENT, null);
List<QNodeDefinition> nds = new ArrayList<QNodeDefinition>();
while (it.hasNext()) {
nds.add(createQNodeDefinition(builder.getName(), it.nextElement(), resolver));
}
builder.setChildNodeDefs(nds.toArray(new QNodeDefinition[nds.size()]));
// propertyDefinitions
it = DomUtil.getChildren(ntdElement, PROPERTYDEFINITION_ELEMENT, null);
List<QPropertyDefinition> pds = new ArrayList<QPropertyDefinition>();
while (it.hasNext()) {
pds.add(createQPropertyDefinition(builder.getName(), it.nextElement(), resolver, qValueFactory));
}
builder.setPropertyDefs(pds.toArray(new QPropertyDefinition[pds.size()]));
} catch (NameException e) {
log.error(e.getMessage());
throw new RepositoryException(e);