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

How to use
getDouble
method
in
javax.jcr.Property

Best Java code snippets using javax.jcr.Property.getDouble (Showing top 20 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: org.onehippo.cms7/hippo-repository-connector

/**
 * @inheritDoc
 */
public double getDouble() throws ValueFormatException, RepositoryException {
  return property.getDouble();
}
origin: org.apache.sling/org.apache.sling.scripting.javascript

public Object jsGet_double() {
  try {
    return property.getDouble();
  } catch (RepositoryException re) {
    return Undefined.instance;
  }
}
origin: org.onehippo.cms7.essentials/hippo-essentials-plugin-api-implementation

public static Double getDoubleProperty(final Node node, final String property) throws RepositoryException {
  if (node.hasProperty(property)) {
    return node.getProperty(property).getDouble();
  } else {
    return null;
  }
}
origin: org.onehippo.cms7.essentials.sdk/implementation

public static Double getDoubleProperty(final Node node, final String property) throws RepositoryException {
  if (node.hasProperty(property)) {
    return node.getProperty(property).getDouble();
  } else {
    return null;
  }
}
origin: org.onehippo.cms7/hippo-repository-engine

private long getPasswordMaxAge() throws RepositoryException {
  Node securityNode = session.getRootNode().getNode(SECURITY_PATH);
  if (securityNode.hasProperty(HippoNodeType.HIPPO_PASSWORDMAXAGEDAYS)) {
    return (long) (securityNode.getProperty(HippoNodeType.HIPPO_PASSWORDMAXAGEDAYS).getDouble() * ONEDAYMS);
  }
  return -1l;
}
origin: org.onehippo.cms7/hippo-repository-engine

private String getLastExecutedAction(final Node moduleNode) throws RepositoryException {
  if (moduleNode.hasProperty(HCM_LAST_EXECUTED_ACTION)) {
    return moduleNode.getProperty(HCM_LAST_EXECUTED_ACTION).getString();
  }
  // backwards compatibility with baselines stored during v12-beta
  else if (moduleNode.hasProperty(HCM_MODULE_SEQUENCE)) {
    return Double.toString(moduleNode.getProperty(HCM_MODULE_SEQUENCE).getDouble());
  } else {
    return null;
  }
}
origin: apache/jackrabbit

/**
 * Tests if adding a property with <code>Node.setProperty(String,
 * double)</code> works with <code>Session.save()</code>
 */
public void testNewDoublePropertySession() throws Exception {
  testNode.setProperty(propertyName1, d1);
  superuser.save();
  assertEquals("Setting property with Node.setProperty(String, double) and Session.save() not working",
      new Double(d1),
      new Double(testNode.getProperty(propertyName1).getDouble()));
}
origin: info.magnolia/magnolia-core

@Override
public double getDouble() throws ValueFormatException, RepositoryException {
  return getWrappedProperty().getDouble();
}
origin: apache/jackrabbit

/**
 * Tests if adding a property with <code>Node.setProperty(String,
 * double)</code> works with <code>parentNode.save()</code>
 */
public void testNewDoublePropertyParent() throws Exception {
  testNode.setProperty(propertyName1, d1);
  testRootNode.getSession().save();
  assertEquals("Setting property with Node.setProperty(String, double) and parentNode.save() not working",
      new Double(d1),
      new Double(testNode.getProperty(propertyName1).getDouble()));
}
origin: apache/jackrabbit

/**
 * Tests if modifying a property with <code>Node.setProperty(String,
 * double)</code> works with <code>Session.save()</code>
 */
public void testModifyDoublePropertySession() throws Exception {
  testNode.setProperty(propertyName1, d1);
  superuser.save();
  testNode.setProperty(propertyName1, d2);
  superuser.save();
  assertEquals("Modifying property with Node.setProperty(String, double) and Session.save() not working",
      new Double(d2),
      new Double(testNode.getProperty(propertyName1).getDouble()));
}
origin: brix-cms/brix-cms

  public Double execute() throws Exception {
    return getDelegate().getDouble();
  }
});
origin: apache/jackrabbit

/**
 * Tests if modifying a property with <code>Node.setProperty(String,
 * double)</code> works with <code>parentNode.save()</code>
 */
public void testModifyDoublePropertyParent() throws Exception {
  testNode.setProperty(propertyName1, d1);
  testRootNode.getSession().save();
  testNode.setProperty(propertyName1, d2);
  testRootNode.getSession().save();
  assertEquals("Modifying property with Node.setProperty(String, double) and parentNode.save() not working",
      new Double(d2),
      new Double(testNode.getProperty(propertyName1).getDouble()));
}
origin: apache/jackrabbit

  /**
   * Tests that in infinity and NaN values can be persisted and round-tripped.
   */
  public void testEdgeCases() throws Exception {
    double tests[] = { Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY };
    String path = testNode.getPath();

    for (double v : tests) {
      testNode.setProperty(propertyName1, v);
      testRootNode.getSession().save();
      assertEquals("Round-trip of " + v, v, superuser.getNode(path).getProperty(propertyName1).getDouble());
    }
  }
}
origin: info.magnolia/magnolia-core

public double getDoubleProperty(String name) {
  try {
    final Property property = getJCRProperty(name);
    if (property != null) {
      return property.getDouble();
    }
  } catch (RepositoryException re) {
    log.error(re.getMessage(), re);
  }
  return 0d;
}
origin: com.btmatthews.atlas/atlas-jcr

public Double getDoubleProperty(final Node node, final String name, final Double defaultValue) {
  try {
    return node.getProperty(name).getDouble();
  } catch (final PathNotFoundException e) {
    return defaultValue;
  } catch (final RepositoryException e) {
    throw new RepositoryAccessException(e.getMessage(), e);
  }
}
origin: org.onehippo.cms7/hippo-cms-api

@Override
public double getDouble(String key, double defaultValue) throws StringValueConversionException {
  try {
    Property property = getProperty(key);
    if (property != null) {
      return property.getDouble();
    }
  } catch (RepositoryException ex) {
    log.error(ex.getMessage());
  }
  return defaultValue;
}
origin: info.magnolia/magnolia-core

@Override
public double getDouble() {
  if (isExist()) {
    try {
      return getJCRProperty().getDouble();
    } catch (RepositoryException e) {
      throw new RuntimeException("Can't read value of nodedata " + toString(), e);
    }
  }
  return 0;
}
origin: brix-cms/brix-cms

public double getDouble(Property property) throws RepositoryException {
  if (getPrevious() != null) {
    return getPrevious().getDouble(property);
  } else {
    return property.getDouble();
  }
}
origin: info.magnolia/magnolia-core

@Test
public void setPropertyToDouble() throws Exception {
  // GIVEN
  final Object value = Double.valueOf("42.195");
  PropertyUtil.setProperty(root, PROPERTY_NAME, value);
  // WHEN
  double res = root.getProperty(PROPERTY_NAME).getDouble();
  // THEN
  assertEquals(value, res);
}
origin: apache/jackrabbit-oak

@Test
public void setDoubleNaNProperty() throws RepositoryException, IOException {
  Node parentNode = getNode(TEST_PATH);
  addProperty(parentNode, "NaN", getAdminSession().getValueFactory().createValue(Double.NaN));
  Session session2 = createAnonymousSession();
  try {
    Property property2 = session2.getProperty(TEST_PATH + "/NaN");
    assertTrue(Double.isNaN(property2.getDouble()));
  } finally {
    session2.logout();
  }
}
javax.jcrPropertygetDouble

Javadoc

Returns a double representation of the value of this property. A shortcut for Property.getValue().getDouble().

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,
  • getStream,
  • getSession

Popular in Java

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onCreateOptionsMenu (Activity)
  • runOnUiThread (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Path (java.nio.file)
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • BoxLayout (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • IsNull (org.hamcrest.core)
    Is the value null?
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