Tabnine Logo
Property.getDouble
Code IndexAdd Tabnine 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)

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

  • Updating database using SQL prepared statement
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • requestLocationUpdates (LocationManager)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Kernel (java.awt.image)
  • Permission (java.security)
    Legacy security code; do not use.
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now