Codota Logo
Property.getProperty
Code IndexAdd Codota to your IDE (free)

How to use
getProperty
method
in
javax.jcr.Property

Best Java code snippets using javax.jcr.Property.getProperty (Showing top 17 results out of 315)

  • Common ways to obtain Property
private void myMethod () {
Property p =
  • Codota IconNode node;String name;String value;node.setProperty(name, value)
  • Codota IconNode node;String relPath;node.getProperty(relPath)
  • Codota IconPropertyIterator iter;iter.nextProperty()
  • Smart code suggestions by Codota
}
origin: net.adamcin.oakpal/oakpal-core

@Override
public Property getProperty() throws RepositoryException {
  Property internalProperty = delegate.getProperty();
  return new PropertyFacade<>(internalProperty, session);
}
origin: apache/jackrabbit

/**
 * Tests dereferencing a REFERENCE property to a Property
 * @since JCR 2.0
 */
public void testGetProperty() throws RepositoryException {
  try {
    prop.getProperty();
    fail("A REFERENCE property cannot be resolved to a Property.");
  } catch (ValueFormatException e) {
    // ok
  }
}
origin: info.magnolia/magnolia-core

@Override
public Property getProperty() throws ItemNotFoundException, ValueFormatException, RepositoryException {
  return getWrappedProperty().getProperty();
}
origin: org.onehippo.cms7/hippo-repository-connector

public Property getProperty() throws ItemNotFoundException, ValueFormatException, RepositoryException {
  return factory.getPropertyDecorator(session, property.getProperty());
}
origin: apache/jackrabbit

/**
 * Tests the conversion from Binary type to Path type. This conversion
 * passes through previous String conversion.
 */
public void testGetProperty() throws RepositoryException, NotExecutableException {
  if (!multiple) {
    // not testable since format of ID is implementation specific
  } else {
    try {
      prop.getProperty();
      fail("Property.getProperty() called on a multivalue property " +
          "should throw a ValueFormatException.");
    } catch (ValueFormatException vfe) {
      // ok
    }
  }
}

origin: apache/jackrabbit

/**
 * Tests conversion from String type to Reference or Path type.
 */
public void testGetProperty() throws RepositoryException, NotExecutableException {
  if (!multiple) {
    // not testable as a STRING may or may not be convertable to Path or Reference
  } else {
    try {
      prop.getProperty();
      fail("Property.getNode() called on a multivalue property " +
          "should throw a ValueFormatException.");
    } catch (ValueFormatException vfe) {
      // ok
    }
  }
}
origin: apache/jackrabbit

/**
 * Tests failure of conversion from Double type to Path type.
 */
public void testGetProperty() throws RepositoryException {
  if (!multiple) {
    try {
      prop.getProperty();
      fail("Conversion from a Double value to a Path value " +
          "should throw a ValueFormatException.");
    } catch (ValueFormatException e) {
      // success.
    }
  } else {
    try {
      prop.getProperty();
      fail("Property.getProperty() called on a multivalue property " +
          "should throw a ValueFormatException.");
    } catch (ValueFormatException vfe) {
      // ok
    }
  }
}
origin: apache/jackrabbit

/**
 * Tests failure of conversion from Long type to Path type.
 */
public void testGetProperty() throws RepositoryException {
  if (!multiple) {
    try {
      prop.getProperty();
      fail("Conversion from a Long value to a Path value " +
          "should throw a ValueFormatException.");
    } catch (ValueFormatException e) {
      // success.
    }
  } else {
    try {
      prop.getProperty();
      fail("Property.getProperty() called on a multivalue property " +
          "should throw a ValueFormatException.");
    } catch (ValueFormatException vfe) {
      // ok
    }
  }
}
origin: apache/jackrabbit

/**
 * Tests failure of conversion from Boolean type to Path type.
 */
public void testGetProperty() throws RepositoryException {
  if (!multiple) {
    try {
      prop.getProperty();
      fail("Conversion from a Boolean value to a Path value " +
          "should throw a ValueFormatException.");
    } catch (ValueFormatException vfe) {
      //ok
    }
  } else {
    try {
      prop.getProperty();
      fail("Property.getProperty() called on a multivalue property " +
          "should throw a ValueFormatException.");
    } catch (ValueFormatException vfe) {
      // ok
    }
  }
}
origin: apache/jackrabbit

/**
 * Tests failure of conversion from Date type to Path type.
 */
public void testGetProperty() throws RepositoryException {
  if (!multiple) {
    try {
      prop.getProperty();
      fail("Conversion from a Date value to a Path value " +
          "should throw a ValueFormatException.");
    } catch (ValueFormatException vfe) {
      //ok
    }
  } else {
    try {
      prop.getProperty();
      fail("Property.getProperty() called on a multivalue property " +
          "should throw a ValueFormatException.");
    } catch (ValueFormatException vfe) {
      // ok
    }
  }
}
origin: apache/jackrabbit

  /**
   * Since JCR 2.0 a path property can be dereferenced if it points to a
   * Property.
   * TODO: create several tests out of this one
   */
  public void testGetProperty() throws RepositoryException {
    if (!multiple) {
      String path = prop.getString();
      if (prop.getParent().hasProperty(path)) {
        Property p = prop.getProperty();
        assertEquals("The name of the dereferenced property must be equal to the value", path, p.getName());
      } else {
        try {
          prop.getProperty();
          fail("Calling Property.getProperty() for a NAME value that doesn't have a corresponding Node, ItemNotFoundException is expected");
        } catch (ItemNotFoundException e) {
          // success.
        }
      }
    } else {
      try {
        prop.getProperty();
        fail("Property.getNode() called on a multivalue property " +
            "should throw a ValueFormatException.");
      } catch (ValueFormatException vfe) {
        // ok
      }
    }
  }
}
origin: brix-cms/brix-cms

public Property getProperty() throws ItemNotFoundException, ValueFormatException,
    RepositoryException {
  return PropertyWrapper.wrap(getDelegate().getProperty(), getSessionWrapper());
}
origin: brix-cms/brix-cms

  public JcrProperty execute() throws Exception {
    return JcrProperty.Wrapper.wrap(getDelegate().getProperty(), getJcrSession());
  }
});
origin: net.adamcin.commons/net.adamcin.commons.jcr

public Property getProperty() throws RepositoryException {
  Property property = this.item.getProperty();
  return new PropertyProxy(property, new NodeProxy(property.getParent()));
}
origin: apache/jackrabbit

Property p = prop.getProperty();
assertEquals("The path of the dereferenced property must be equal to the value", path, p.getPath());
assertTrue("The property value must be resolved to the correct property.", prop.isSame(p));
p = prop.getProperty();
assertEquals("The path of the dereferenced property must be equal to the value", path, p.getName());
assertTrue("The property value must be resolved to the correct property.", prop.getParent().getProperty(path).isSame(p));
  prop.getProperty();
  fail("Calling Property.getProperty() for a PATH value that doesn't have a corresponding Property, ItemNotFoundException is expected");
} catch (ItemNotFoundException e) {
  prop.getProperty();
  fail("Property.getNode() called on a multivalue property " +
      "should throw a ValueFormatException.");
origin: info.magnolia/magnolia-core

@Test
public void testPropertyReturnedFromPropertyIsWrapped() throws Exception {
  MockSession session = new MockSession("sessionName");
  Node rootNode = session.getRootNode();
  Node referredTo = rootNode.addNode("referredTo");
  referredTo.setProperty("text", "<html/>");
  Node referrer = rootNode.addNode("referrer");
  referrer.setProperty("reference", "/referredTo/text"); // Reference to a property
  HTMLEscapingNodeWrapper wrapper = new HTMLEscapingNodeWrapper(referrer, false);
  Property property = wrapper.getProperty("reference").getProperty();
  assertTrue(property instanceof HTMLEscapingPropertyWrapper);
  assertEquals("&lt;html/&gt;", property.getString());
}
origin: info.magnolia/magnolia-core

@Test
public void returnsWrappedPropertyGetPropertyFromProperty() throws Exception {
  // GIVEN
  MockSession session = new MockSession("blah");
  Node node = session.getRootNode().addNode("foo");
  ContentDecoratorNodeWrapper wrapped = new ContentDecoratorNodeWrapper(node, new ContentDecoratorSuperClass());
  // WHEN
  Property test = wrapped.setProperty("test", "/foo/test");
  // THEN
  assertEquals(wrapped.getProperty("test").getProperty(), test);
}
javax.jcrPropertygetProperty

Javadoc

If this property is of type PATH (or convertible to this type) this method returns the Property to which this property refers.

If this property contains a relative path, it is interpreted relative to the parent node of this property. Therefore, when resolving such a relative path, the segment "." refers to the parent node itself, ".." to the parent of the parent node and "foo" to a sibling property of this property or this property itself.

For example, if this property is located at /a/b/c and it has a value of "../d" then this method will return the property at /a/d if such exists.

If this property is multi-valued, this method throws a ValueFormatException.

If this property cannot be converted to a PATH then a ValueFormatException is thrown.

If this property is currently part of the frozen state of a version in version storage, this method will throw a ValueFormatException.

Popular methods of Property

  • getString
    Returns a String representation of the value of this property. A shortcut for Property.getValue().g
  • getValues
    Returns an array of all the values of this property. Used to access multi-value properties. The arra
  • getValue
    Returns the value of this property as a Value object. The object returned is a copy of the stored va
  • getName
  • getType
    Returns the type of this Property. One of: * PropertyType.STRING * PropertyType.BINARY * Property
  • getBinary
    Returns a Binary representation of the value of this property. A shortcut for Property.getValue().g
  • getBoolean
    Returns a boolean representation of the value of this property. A shortcut for Property.getValue().
  • remove
  • isMultiple
    Returns true if this property is multi-valued andfalse if this property is single-valued.
  • getDate
    Returns a Calendar representation of the value of this property. A shortcut for Property.getValue()
  • getLong
    Returns a long representation of the value of this property. A shortcut for Property.getValue().get
  • getDefinition
    Returns the property definition that applies to this property. In some cases there may appear to be
  • getLong,
  • getDefinition,
  • setValue,
  • getParent,
  • getPath,
  • getNode,
  • getLength,
  • getDouble,
  • getStream,
  • getSession

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • addToBackStack (FragmentTransaction)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JPanel (javax.swing)
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now