use of org.apache.jackrabbit.oak.spi.xml.ProtectedPropertyImporter in project jackrabbit-oak by apache.
the class ImporterImpl method importProperties.
private void importProperties(@Nonnull Tree tree, @Nonnull List<PropInfo> propInfos, boolean ignoreRegular) throws RepositoryException {
// process properties
for (PropInfo pi : propInfos) {
// find applicable definition
// TODO find better heuristics?
EffectiveNodeType ent = effectiveNodeTypeProvider.getEffectiveNodeType(tree);
PropertyDefinition def = ent.getPropertyDefinition(pi.getName(), pi.getType(), pi.isUnknownMultiple());
if (def.isProtected()) {
// skip protected property
log.debug("Protected property {}", pi.getName());
// notify the ProtectedPropertyImporter.
for (ProtectedPropertyImporter ppi : getPropertyImporters()) {
if (ppi.handlePropInfo(tree, pi, def)) {
log.debug("Protected property -> delegated to ProtectedPropertyImporter");
break;
}
/* else: p-i-Importer isn't able to deal with this property. try next pp-importer */
}
} else if (!ignoreRegular) {
// regular property -> create the property
createProperty(tree, pi, def);
}
}
for (ProtectedPropertyImporter ppi : getPropertyImporters()) {
ppi.propertiesCompleted(tree);
}
}
Aggregations