當前位置: 首頁>>代碼示例>>Java>>正文


Java PathUtils.getNode方法代碼示例

本文整理匯總了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);
}
 
開發者ID:dooApp,項目名稱:jcromfx,代碼行數:14,代碼來源:ChildNodeLoader.java

示例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;
}
 
開發者ID:dooApp,項目名稱:jcromfx,代碼行數:12,代碼來源:ReferenceMapper.java

示例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;
        }
    }
 
開發者ID:dooApp,項目名稱:jcromfx,代碼行數:40,代碼來源:ReferenceMapper.java

示例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);
}
 
開發者ID:dooApp,項目名稱:jcromfx,代碼行數:9,代碼來源:ChildNodeListLoader.java

示例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);
}
 
開發者ID:dooApp,項目名稱:jcromfx,代碼行數:9,代碼來源:ReferenceLoader.java

示例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);
}
 
開發者ID:dooApp,項目名稱:jcromfx,代碼行數:9,代碼來源:FileNodeListLoader.java

示例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);
}
 
開發者ID:dooApp,項目名稱:jcromfx,代碼行數:9,代碼來源:ReferenceListLoader.java

示例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);
}
 
開發者ID:dooApp,項目名稱:jcromfx,代碼行數:9,代碼來源:FileNodeLoader.java

示例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;
        }
    }
 
開發者ID:sbrinkmann,項目名稱:jcrom-extended,代碼行數:40,代碼來源:ReferenceMapper.java

示例10: getNode

import org.jcrom.util.PathUtils; //導入方法依賴的package包/類
protected Node getNode(String absolutePath) throws RepositoryException {
    return PathUtils.getNode(absolutePath, getSession());
}
 
開發者ID:dooApp,項目名稱:jcromfx,代碼行數:4,代碼來源:AbstractJcrDAO.java


注:本文中的org.jcrom.util.PathUtils.getNode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。