本文整理汇总了Java中org.jcrom.util.PathUtils.getNode方法的典型用法代码示例。如果您正苦于以下问题:Java PathUtils.getNode方法的具体用法?Java PathUtils.getNode怎么用?Java PathUtils.getNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jcrom.util.PathUtils
的用法示例。
在下文中一共展示了PathUtils.getNode方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doLoadObject
import org.jcrom.util.PathUtils; //导入方法依赖的package包/类
@Override
protected Object doLoadObject(Session session, Mapper mapper) throws Exception {
if (logger.isLoggable(Level.FINE)) {
logger.fine("Lazy loading single child for " + containerPath);
}
Node node;
if (pathIsContainer) {
node = PathUtils.getNode(containerPath, session).getNodes().nextNode();
} else {
node = PathUtils.getNode(containerPath, session);
}
return mapper.getChildNodeMapper().getSingleChild(objectClass, node, parentObject, mapper, depth, nodeFilter);
}
示例2: getSingleReferencedNode
import org.jcrom.util.PathUtils; //导入方法依赖的package包/类
private Node getSingleReferencedNode(JcrReference jcrReference, Value value, Session session) throws RepositoryException {
if (jcrReference.byPath()) {
if (session.getRootNode().hasNode(PathUtils.relativePath(value.getString()))) {
return PathUtils.getNode(value.getString(), session);
}
} else {
//return session.getNodeByUUID(value.getString());
return PathUtils.getNodeById(value.getString(), session);
}
return null;
}
示例3: createReferencedObject
import org.jcrom.util.PathUtils; //导入方法依赖的package包/类
Object createReferencedObject(Field field, Value value, Object obj, Session session, Class<?> referenceObjClass, int depth, NodeFilter nodeFilter, Mapper mapper) throws ClassNotFoundException, InstantiationException, RepositoryException, IllegalAccessException, IOException {
JcrReference jcrReference = mapper.getJcrom().getAnnotationReader().getAnnotation(field, JcrReference.class);
Node referencedNode = null;
if (jcrReference.byPath()) {
if (session.getRootNode().hasNode(PathUtils.relativePath(value.getString()))) {
referencedNode = PathUtils.getNode(value.getString(), session);
}
} else {
//referencedNode = session.getNodeByUUID(value.getString());
referencedNode = PathUtils.getNodeById(value.getString(), session);
}
if (referencedNode != null) {
Object referencedObject = mapper.createInstanceForNode(referenceObjClass, referencedNode);
if (nodeFilter.isIncluded(field.getName(), depth)) {
// load and map the object, we don't send the current object as parent
referencedObject = mapper.mapNodeToClass(referencedObject, referencedNode, nodeFilter, null, depth + 1);
} else {
if (jcrReference.byPath()) {
// just store the path
mapper.setNodePath(referencedObject, value.getString());
} else {
// just store the Identifier
mapper.setUUID(referencedObject, value.getString());
mapper.setId(referencedObject, value.getString());
}
}
// support JcrFileNode annotation for references
if (field.isAnnotationPresent(JcrFileNode.class) && referencedObject instanceof JcrFile) {
JcrFileNode fileNode = field.getAnnotation(JcrFileNode.class);
FileNodeMapper.addFileProperties((JcrFile) referencedObject, referencedNode, fileNode, depth, nodeFilter);
}
return referencedObject;
} else {
return null;
}
}
示例4: doLoadObject
import org.jcrom.util.PathUtils; //导入方法依赖的package包/类
@Override
protected Object doLoadObject(Session session, Mapper mapper) throws Exception {
if (logger.isLoggable(Level.FINE)) {
logger.fine("Lazy loading children list for " + containerPath);
}
Node childrenContainer = PathUtils.getNode(containerPath, session);
return mapper.getChildNodeMapper().getChildrenList(objectClass, childrenContainer, parentObject, mapper, depth, nodeFilter, jcrChildNode);
}
示例5: doLoadObject
import org.jcrom.util.PathUtils; //导入方法依赖的package包/类
@Override
protected Object doLoadObject(Session session, Mapper mapper) throws Exception {
if (logger.isLoggable(Level.FINE)) {
logger.fine("Lazy loading single reference for " + nodePath + " " + propertyName);
}
Node node = PathUtils.getNode(nodePath, session);
return mapper.getReferenceMapper().createReferencedObject(field, node.getProperty(propertyName).getValue(), parentObject, session, objClass, depth, nodeFilter, mapper);
}
示例6: doLoadObject
import org.jcrom.util.PathUtils; //导入方法依赖的package包/类
@Override
protected Object doLoadObject(Session session, Mapper mapper) throws Exception {
if (logger.isLoggable(Level.FINE)) {
logger.fine("Lazy loading file list for " + fileContainerPath);
}
Node fileContainer = PathUtils.getNode(fileContainerPath, session);
return mapper.getFileNodeMapper().getFileList(objectClass, fileContainer, parentObject, jcrFileNode, depth, nodeFilter, mapper);
}
示例7: doLoadObject
import org.jcrom.util.PathUtils; //导入方法依赖的package包/类
@Override
protected Object doLoadObject(Session session, Mapper mapper) throws Exception {
if (logger.isLoggable(Level.FINE)) {
logger.fine("Lazy loading reference list for " + nodePath + " " + propertyName);
}
Node node = PathUtils.getNode(nodePath, session);
return mapper.getReferenceMapper().getReferenceList(field, propertyName, objClass, node, parentObject, depth, nodeFilter, mapper);
}
示例8: doLoadObject
import org.jcrom.util.PathUtils; //导入方法依赖的package包/类
@Override
protected Object doLoadObject(Session session, Mapper mapper) throws Exception {
if (logger.isLoggable(Level.FINE)) {
logger.fine("Lazy loading file node for " + fileContainerPath);
}
Node fileContainer = PathUtils.getNode(fileContainerPath, session);
return mapper.getFileNodeMapper().getSingleFile(objectClass, fileContainer, parentObject, jcrFileNode, depth, nodeFilter, mapper);
}
示例9: createReferencedObject
import org.jcrom.util.PathUtils; //导入方法依赖的package包/类
Object createReferencedObject(Field field, Value value, Object obj, Session session, Class<?> referenceObjClass, int depth, NodeFilter nodeFilter, Mapper mapper) throws ClassNotFoundException, InstantiationException, RepositoryException, IllegalAccessException, IOException {
JcrReference jcrReference = mapper.getJcrom().getAnnotationReader().getAnnotation(field, JcrReference.class);
Node referencedNode = null;
if (jcrReference.byPath()) {
if (session.getRootNode().hasNode(PathUtils.relativePath(value.getString()))) {
referencedNode = PathUtils.getNode(value.getString(), session);
}
} else {
//referencedNode = session.getNodeByUUID(value.getString());
referencedNode = PathUtils.getNodeById(value.getString(), session);
}
if (referencedNode != null) {
Object referencedObject = mapper.createInstanceForNode(referenceObjClass, referencedNode);
if (nodeFilter.isIncluded(field.getName(), depth)) {
// load and map the object, we don't send the current object as parent
referencedObject = mapper.mapNodeToClass(referencedObject, referencedNode, nodeFilter, depth + 1);
} else {
if (jcrReference.byPath()) {
// just store the path
mapper.setNodePath(referencedObject, value.getString());
} else {
// just store the Identifier
mapper.setUUID(referencedObject, value.getString());
mapper.setId(referencedObject, value.getString());
}
}
// support JcrFileNode annotation for references
if (field.isAnnotationPresent(JcrFileNode.class) && referencedObject instanceof JcrFile) {
JcrFileNode fileNode = field.getAnnotation(JcrFileNode.class);
FileNodeMapper.addFileProperties((JcrFile) referencedObject, referencedNode, fileNode, depth, nodeFilter);
}
return referencedObject;
} else {
return null;
}
}
示例10: getNode
import org.jcrom.util.PathUtils; //导入方法依赖的package包/类
protected Node getNode(String absolutePath) throws RepositoryException {
return PathUtils.getNode(absolutePath, getSession());
}