use of com.enonic.xp.site.XDataMapping in project xp by enonic.
the class XmlSiteParser method toXDataMapping.
private XDataMapping toXDataMapping(final DomElement xDataElement) {
final XDataMapping.Builder builder = XDataMapping.create();
final ApplicationRelativeResolver resolver = new ApplicationRelativeResolver(this.currentApplication);
final String name = xDataElement.getAttribute(X_DATA_ATTRIBUTE_NAME);
builder.xDataName(resolver.toXDataName(name));
final String allowContentTypes = xDataElement.getAttribute(X_DATA_CONTENT_TYPE_ATTRIBUTE);
builder.allowContentTypes(allowContentTypes);
final String optional = xDataElement.getAttribute(X_DATA_OPTIONAL_ATTRIBUTE);
if (optional != null) {
builder.optional(Boolean.valueOf(optional));
}
return builder.build();
}
Aggregations