Package javax.jcr

Examples of javax.jcr.PropertyIterator.nextProperty()


    public PropertyIterator getProperties(String namePattern) throws RepositoryException {
        PropertyIterator iterator = getProperties();
        List<Property> properties = new ArrayList<Property>();

        while (iterator.hasNext()) {
            Property p = iterator.nextProperty();
            String name = p.getName();
            if (ChildrenCollectorFilter.matches(name, namePattern)) {
                properties.add(p);
            }
        }
View Full Code Here


    void readFully() {
        if (!fullyRead) {
            try {
                final PropertyIterator pi = node.getProperties();
                while (pi.hasNext()) {
                    final Property prop = pi.nextProperty();
                    this.cacheProperty(prop);
                }
                fullyRead = true;
            } catch (final RepositoryException re) {
                throw new IllegalArgumentException(re);
View Full Code Here

    void readFully() {
        if (!fullyRead) {
            try {
                final PropertyIterator pi = node.getProperties();
                while (pi.hasNext()) {
                    final Property prop = pi.nextProperty();
                    this.cacheProperty(prop);
                }
                fullyRead = true;
            } catch (final RepositoryException re) {
                throw new IllegalArgumentException(re);
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    protected void readPreferences(PreferencesImpl prefs, Session session, Node node) throws RepositoryException {
        final PropertyIterator iterator = node.getProperties();
        while ( iterator.hasNext() ) {
            final Property prop = iterator.nextProperty();
            if ( prop.getName().startsWith(this.namespacePrefixSep) ) {
                prefs.getProperties().put(prop.getName(), prop.getString());
            }
        }
    }
View Full Code Here

        Node node = session.getNode(getPath());
        HashMap<String, Object> map = new HashMap<String, Object>();

        PropertyIterator properties = node.getProperties();
        while (properties.hasNext()) {
          Property p = properties.nextProperty();
          if (p.getType() == PropertyType.BOOLEAN) {
            map.put(p.getName(), p.getBoolean());
          } else if (p.getType() == PropertyType.STRING) {
            map.put(p.getName(), p.getString());
          } else if (p.getType() == PropertyType.DATE) {
View Full Code Here

          try {
            final Node node = session.getNode(getPath());
            final PropertyIterator pi = node.getProperties();
            final Set<String> result = new HashSet<String>();
            while(pi.hasNext()) {
              final Property p = pi.nextProperty();
              result.add(p.getName());
            }
            return result;
          } catch (RepositoryException e) {
            throw new RuntimeException(e);
View Full Code Here

                Node node = session.getNode(getPath());
                HashMap<String, Object> map = new HashMap<String, Object>();

                PropertyIterator properties = node.getProperties();
                while (properties.hasNext()) {
                    Property p = properties.nextProperty();
                    List valuesList;
                    if (p.isMultiple()) {
                        switch (p.getType()) {
                            case PropertyType.STRING:
                                valuesList = new ArrayList<String>();
View Full Code Here

                    try {
                        final Node node = session.getNode(getPath());
                        final PropertyIterator pi = node.getProperties();
                        final Set<String> result = new HashSet<String>();
                        while (pi.hasNext()) {
                            final Property p = pi.nextProperty();
                            result.add(p.getName());
                        }
                        return result;
                    } catch (RepositoryException e) {
                        throw new RuntimeException(e);
View Full Code Here

    /** Load properties of n into d */
    protected void loadProperties(Dictionary<String, Object> d, Node n) throws RepositoryException {
        final PropertyIterator pi = n.getProperties();
        while(pi.hasNext()) {
            final Property p = pi.nextProperty();
            final String name = p.getName();

            // ignore jcr: and similar properties
            if(name.contains(":")) {
                continue;
View Full Code Here

            } else if (JcrConstants.JCR_GET_BY_ID.equals(operation)) {
                Node node = session.getNodeByIdentifier(exchange.getIn()
                        .getMandatoryBody(String.class));
                PropertyIterator properties = node.getProperties();
                while (properties.hasNext()) {
                    Property property = properties.nextProperty();
                    Class<?> aClass = classForJCRType(property);
                    Object value;
                    if (property.isMultiple()) {
                        value = converter.convertTo(aClass, exchange, property.getValues());
                    } else {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.