Tabnine Logo
Property.getDecimal
Code IndexAdd Tabnine to your IDE (free)

How to use
getDecimal
method
in
javax.jcr.Property

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

origin: net.adamcin.oakpal/oakpal-core

@Override
public BigDecimal getDecimal() throws RepositoryException {
  return delegate.getDecimal();
}
origin: org.onehippo.cms7/hippo-repository-connector

public BigDecimal getDecimal() throws ValueFormatException, RepositoryException {
  return property.getDecimal();
}
origin: net.adamcin.commons/net.adamcin.commons.jcr

public BigDecimal getDecimal() throws RepositoryException
{ return this.item.getDecimal(); }
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

/**
 * Returns the decimal property value at <code>relPath</code> from <code>baseNode</code> or <code>defaultValue</code>
 * if no such property exists.
 *
 * @param baseNode  existing node that should be the base for the relative path
 * @param relPath  relative path to the property to get
 * @param defaultValue  default value to return when the property does not exist
 * @return  the decimal property value at <code>relPath</code> from <code>baseNode</code> or <code>defaultValue</code>
 * if no such property exists
 * @throws RepositoryException  in case of exception accessing the Repository
 */
public static BigDecimal getDecimalProperty(Node baseNode, String relPath, BigDecimal defaultValue) throws RepositoryException {
  try {
    return baseNode.getProperty(relPath).getDecimal();
  } catch (PathNotFoundException e) {
    return defaultValue;
  }
}
origin: org.onehippo.cms7/hippo-repository-api

/**
 * Returns the decimal property value at <code>relPath</code> from <code>baseNode</code> or
 * <code>defaultValue</code> if no such property exists.
 *
 * @param baseNode     existing node that should be the base for the relative path
 * @param relPath      relative path to the property to get
 * @param defaultValue default value to return when the property does not exist
 * @return the decimal property value at <code>relPath</code> from <code>baseNode</code> or
 *         <code>defaultValue</code> if no such property exists
 * @throws RepositoryException in case of exception accessing the Repository
 */
public static BigDecimal getDecimalProperty(Node baseNode, String relPath, BigDecimal defaultValue) throws RepositoryException {
  try {
    return baseNode.getProperty(relPath).getDecimal();
  } catch (PathNotFoundException e) {
    return defaultValue;
  }
}
origin: org.apache.jackrabbit/jackrabbit-jcr-commons

/**
 * Returns the decimal property value at <code>relPath</code> from <code>baseNode</code> or <code>defaultValue</code>
 * if no such property exists.
 *
 * @param baseNode  existing node that should be the base for the relative path
 * @param relPath  relative path to the property to get
 * @param defaultValue  default value to return when the property does not exist
 * @return  the decimal property value at <code>relPath</code> from <code>baseNode</code> or <code>defaultValue</code>
 * if no such property exists
 * @throws RepositoryException  in case of exception accessing the Repository
 */
public static BigDecimal getDecimalProperty(Node baseNode, String relPath, BigDecimal defaultValue) throws RepositoryException {
  try {
    return baseNode.getProperty(relPath).getDecimal();
  } catch (PathNotFoundException e) {
    return defaultValue;
  }
}
origin: apache/jackrabbit

/**
 * Returns the decimal property value at <code>relPath</code> from <code>baseNode</code> or <code>defaultValue</code>
 * if no such property exists.
 *
 * @param baseNode  existing node that should be the base for the relative path
 * @param relPath  relative path to the property to get
 * @param defaultValue  default value to return when the property does not exist
 * @return  the decimal property value at <code>relPath</code> from <code>baseNode</code> or <code>defaultValue</code>
 * if no such property exists
 * @throws RepositoryException  in case of exception accessing the Repository
 */
public static BigDecimal getDecimalProperty(Node baseNode, String relPath, BigDecimal defaultValue) throws RepositoryException {
  try {
    return baseNode.getProperty(relPath).getDecimal();
  } catch (PathNotFoundException e) {
    return defaultValue;
  }
}
origin: info.magnolia/magnolia-core

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

/**
 * Tests if adding a property with <code>Node.setProperty(String,
 * BigDecimal)</code> works with <code>Session.save()</code>
 */
public void testNewDecimalPropertySession() throws Exception {
  testNode.setProperty(propertyName1, b1);
  superuser.save();
  assertEquals("Setting property with Node.setProperty(String, double) and Session.save() not working",
      b1,
      testNode.getProperty(propertyName1).getDecimal());
}
origin: apache/jackrabbit

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

  public BigDecimal execute() throws Exception {
    return getDelegate().getDecimal();
  }
});
origin: org.onehippo.cms7/hippo-repository-api

/**
 * Returns the decimal property value at <code>absPath</code> or <code>defaultValue</code> if no such property
 * exists.
 *
 * @param session      to use
 * @param absPath      absolute path to the property to get
 * @param defaultValue default value to return when the property does not exist
 * @return the decimal property value at <code>absPath</code> or <code>defaultValue</code> if no such property
 *         exists
 * @throws RepositoryException in case of exception accessing the Repository
 */
public static BigDecimal getDecimalProperty(Session session, String absPath, BigDecimal defaultValue) throws RepositoryException {
  try {
    return session.getProperty(absPath).getDecimal();
  } catch (PathNotFoundException e) {
    return defaultValue;
  }
}
origin: org.apache.jackrabbit/jackrabbit-jcr-commons

/**
 * Returns the decimal property value at <code>absPath</code> or <code>defaultValue</code>
 * if no such property exists.
 *
 * @param session to use
 * @param absPath  absolute path to the property to get
 * @param defaultValue  default value to return when the property does not exist
 * @return  the decimal property value at <code>absPath</code> or <code>defaultValue</code>
 * if no such property exists
 * @throws RepositoryException  in case of exception accessing the Repository
 */
public static BigDecimal getDecimalProperty(Session session, String absPath, BigDecimal defaultValue) throws RepositoryException {
  try {
    return session.getProperty(absPath).getDecimal();
  } catch (PathNotFoundException e) {
    return defaultValue;
  }
}
origin: apache/jackrabbit

/**
 * Returns the decimal property value at <code>absPath</code> or <code>defaultValue</code>
 * if no such property exists.
 *
 * @param session to use
 * @param absPath  absolute path to the property to get
 * @param defaultValue  default value to return when the property does not exist
 * @return  the decimal property value at <code>absPath</code> or <code>defaultValue</code>
 * if no such property exists
 * @throws RepositoryException  in case of exception accessing the Repository
 */
public static BigDecimal getDecimalProperty(Session session, String absPath, BigDecimal defaultValue) throws RepositoryException {
  try {
    return session.getProperty(absPath).getDecimal();
  } catch (PathNotFoundException e) {
    return defaultValue;
  }
}
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

/**
 * Returns the decimal property value at <code>absPath</code> or <code>defaultValue</code>
 * if no such property exists.
 *
 * @param session to use
 * @param absPath  absolute path to the property to get
 * @param defaultValue  default value to return when the property does not exist
 * @return  the decimal property value at <code>absPath</code> or <code>defaultValue</code>
 * if no such property exists
 * @throws RepositoryException  in case of exception accessing the Repository
 */
public static BigDecimal getDecimalProperty(Session session, String absPath, BigDecimal defaultValue) throws RepositoryException {
  try {
    return session.getProperty(absPath).getDecimal();
  } catch (PathNotFoundException e) {
    return defaultValue;
  }
}
origin: com.btmatthews.atlas/atlas-jcr

public BigDecimal getBigDecimalProperty(final Node node, final String name, final BigDecimal defaultValue) {
  try {
    return node.getProperty(name).getDecimal();
  } catch (final PathNotFoundException e) {
    return defaultValue;
  } catch (final RepositoryException e) {
    throw new RepositoryAccessException(e.getMessage(), e);
  }
}
origin: brix-cms/brix-cms

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

@Test
public void testSetValueWithBigDecimal() throws Exception {
  MockNode node = new MockNode("parent");
  Property property = new MockProperty("test", BigDecimal.valueOf(0), node);
  property.setValue(BigDecimal.ONE);
  assertEquals(BigDecimal.ONE, property.getDecimal());
}
origin: info.magnolia/magnolia-core

@Test
public void setPropertyToBigDecimal() throws Exception {
  // GIVEN
  final Object value = BigDecimal.ONE;
  PropertyUtil.setProperty(root, PROPERTY_NAME, value);
  // WHEN
  BigDecimal res = root.getProperty(PROPERTY_NAME).getDecimal();
  // THEN
  assertEquals(value, res);
}
origin: info.magnolia/magnolia-core

@Test
public void testGetProperties() throws Exception {
  root.setProperty("property1", "string");
  root.setProperty("property2", BigDecimal.TEN);
  PropertyIterator iterator = root.getProperties();
  assertTrue(iterator.hasNext());
  Property current = iterator.nextProperty();
  assertEquals("property1", current.getName());
  assertEquals("string", current.getString());
  current = iterator.nextProperty();
  assertEquals("property2", current.getName());
  assertEquals(BigDecimal.TEN, current.getDecimal());
  assertTrue(!iterator.hasNext());
}
javax.jcrPropertygetDecimal

Javadoc

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

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

  • Reactive rest calls using spring rest template
  • getContentResolver (Context)
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Menu (java.awt)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Best IntelliJ 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