use of org.brackit.xquery.atomic.Una in project sirix by sirixdb.
the class IndexDef method materialize.
@Override
public Node<?> materialize() throws DocumentException {
final FragmentHelper tmp = new FragmentHelper();
tmp.openElement(INDEX_TAG);
tmp.attribute(TYPE_ATTRIBUTE, new Una(mType.toString()));
tmp.attribute(ID_ATTRIBUTE, new Una(Integer.toString(mID)));
if (mContentType != null) {
tmp.attribute(CONTENT_TYPE_ATTRIBUTE, new Una(mContentType.toString()));
}
if (mUnique) {
tmp.attribute(UNIQUE_ATTRIBUTE, new Una(Boolean.toString(mUnique)));
}
if (mPaths != null && !mPaths.isEmpty()) {
for (final Path<QNm> path : mPaths) {
tmp.openElement(PATH_TAG);
// TODO
tmp.content(path.toString());
tmp.closeElement();
}
}
if (!mExcluded.isEmpty()) {
tmp.openElement(EXCLUDING_TAG);
final StringBuilder buf = new StringBuilder();
for (final QNm s : mExcluded) {
buf.append(s + ",");
}
// remove trailing ","
buf.deleteCharAt(buf.length() - 1);
tmp.content(buf.toString());
tmp.closeElement();
}
if (!mIncluded.isEmpty()) {
tmp.openElement(INCLUDING_TAG);
StringBuilder buf = new StringBuilder();
for (final QNm incl : mIncluded) {
buf.append(incl + ",");
}
// remove trailing ","
buf.deleteCharAt(buf.length() - 1);
tmp.content(buf.toString());
tmp.closeElement();
}
//
// if (indexStatistics != null) {
// tmp.insert(indexStatistics.materialize());
// }
tmp.closeElement();
return tmp.getRoot();
}
Aggregations