当前位置: 首页>>代码示例>>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;未经允许,请勿转载。