Package org.modeshape.jcr.cache

Examples of org.modeshape.jcr.cache.CachedNode


                return type;
            }

            @Override
            public Object getValueInRow( RowAccessor row ) {
                CachedNode node = row.getNode(indexInRow);
                if (node == null) return null;
                StringBuilder fullTextString = new StringBuilder();
                Name name = node.getName(cache);
                fullTextString.append(name.getLocalName());
                Iterator<Property> iter = node.getProperties(cache);
                while (iter.hasNext()) {
                    extractFullTextFrom(iter.next(), type, fullTextString, binaries, node, cache);
                }
                if (trace) NodeSequence.LOGGER.trace("Extracting full-text from {0}: {1}", node.getPath(cache), fullTextString);
                // There should always be some content, since every node except the root has a name and even the
                // root node has some properties that will be converted to full-text ...
                return fullTextString.toString();
            }
View Full Code Here


                return type;
            }

            @Override
            public Object getValueInRow( RowAccessor row ) {
                CachedNode node = row.getNode(indexInRow);
                if (node == null) return null;
                Property prop = node.getProperty(propertyName, cache);
                if (prop == null || prop.isEmpty()) return null;
                StringBuilder fullTextString = new StringBuilder();
                extractFullTextFrom(prop, type, fullTextString, binaries, node, cache);
                return fullTextString.toString();
            }
View Full Code Here

                return type;
            }

            @Override
            public Object getValueInRow( RowAccessor row ) {
                CachedNode node = row.getNode(indexInRow);
                if (node == null) return null;
                if (trace) NodeSequence.LOGGER.trace("Extracting node key from {0}: {1}", node.getPath(cache), node.getKey());
                return node.getKey().toString();
            }

            @Override
            public String toString() {
                return "(extract-node-key)";
View Full Code Here

                return type;
            }

            @Override
            public Object getValueInRow( RowAccessor row ) {
                CachedNode node = row.getNode(indexInRow);
                if (node == null) return null;
                NodeKey parentKey = node.getParentKey(cache);
                if (trace) NodeSequence.LOGGER.trace("Extracting parent key from {0}: {1}", node.getPath(cache), parentKey);
                return parentKey != null ? parentKey.toString() : null;
            }

            @Override
            public String toString() {
View Full Code Here

                return type;
            }

            @Override
            public Object getValueInRow( RowAccessor row ) {
                CachedNode node = row.getNode(indexInRow);
                if (node == null) return null;
                Path path = node.getPath(cache);
                if (trace) NodeSequence.LOGGER.trace("Extracting path from {0}", path);
                return path;
            }

            @Override
View Full Code Here

                return type;
            }

            @Override
            public Object getValueInRow( RowAccessor row ) {
                CachedNode node = row.getNode(indexInRow);
                if (node == null) return null;
                NodeKey parentKey = node.getParentKey(cache);
                if (parentKey == null) return null;
                CachedNode parent = cache.getNode(parentKey);
                if (parent == null) return null;
                Path parentPath = parent.getPath(cache);
                if (trace) NodeSequence.LOGGER.trace("Extracting parent path from {0}: {1}", node.getPath(cache), parentPath);
                return parentPath;
            }

            @Override
View Full Code Here

                return type;
            }

            @Override
            public Object getValueInRow( RowAccessor row ) {
                CachedNode node = row.getNode(indexInRow);
                if (node == null) return null;
                Path nodePath = node.getPath(cache);
                try {
                    Path path = nodePath.resolve(relativePath);
                    if (trace) NodeSequence.LOGGER.trace("Extracting relative path {2} from {0}: {2}", node.getPath(cache),
                                                         relativePath, path);
                    return path;
                } catch (InvalidPathException e) {
                    return null;
                }
View Full Code Here

                return type;
            }

            @Override
            public Object getValueInRow( RowAccessor row ) {
                CachedNode node = row.getNode(indexInRow);
                if (node == null) return null;
                Name name = node.getName(cache);
                if (trace) NodeSequence.LOGGER.trace("Extracting name from {0}: {1}", node.getPath(cache), name);
                return name;
            }

            @Override
            public String toString() {
View Full Code Here

                return type;
            }

            @Override
            public Object getValueInRow( RowAccessor row ) {
                CachedNode node = row.getNode(indexInRow);
                String name = node.getName(cache).getLocalName();
                if (trace) NodeSequence.LOGGER.trace("Extracting name from {0}: {1}", node.getPath(cache), name);
                return name;
            }

            @Override
            public String toString() {
View Full Code Here

                                                       final NodeCache cache,
                                                       final TypeFactory<?> desiredType ) {
        return new ExtractFromRow() {
            @Override
            public Object getValueInRow( RowAccessor row ) {
                CachedNode node = row.getNode(indexInRow);
                if (node == null) return null;
                org.modeshape.jcr.value.Property prop = node.getProperty(propertyName, cache);
                return prop == null ? null : desiredType.create(prop.getFirstValue());
            }

            @Override
            public TypeFactory<?> getType() {
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.cache.CachedNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.