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

How to use
getValue
method
in
javax.jcr.Property

Best Java code snippets using javax.jcr.Property.getValue (Showing top 20 results out of 1,134)

Refine searchRefine arrow

  • Node.getProperty
origin: org.onehippo.cms7.essentials/hippo-essentials-clone-component

private void setProperty(final Node newNode, final Node cloneNode, final String propertyName) throws RepositoryException {
  if (cloneNode.hasProperty(propertyName)) {
    final Property property = cloneNode.getProperty(propertyName);
    newNode.setProperty(propertyName, property.getValue());
  }
}
origin: ModeShape/modeshape

protected void verifyProperty( Node node,
                String propertyName,
                String expectedValue ) throws RepositoryException {
  Property property = node.getProperty(propertyName);
  Value value = property.isMultiple() ? property.getValues()[0] : property.getValue();
  assertEquals(expectedValue, value.getString());
}
origin: info.magnolia/magnolia-core

@Override
public boolean hasNodeData(String name) throws RepositoryException {
  if (this.node.hasProperty(name)) {
    return true;
  }
  if (this.node.hasNode(name) && this.node.getNode(name).getProperty("jcr:frozenPrimaryType").getValue().getString().equals(ItemType.NT_RESOURCE)) {
    return true;
  }
  return false;
}
origin: ModeShape/modeshape

protected void verifyProperty( Node node,
                String propertyName,
                long expectedValue ) throws RepositoryException {
  Property property = node.getProperty(propertyName);
  Value value = property.isMultiple() ? property.getValues()[0] : property.getValue();
  assertEquals(expectedValue, value.getLong());
}
origin: info.magnolia/magnolia-core

  protected boolean hasBinaryNode(String name) throws RepositoryException {
    return this.node.hasNode(name) && (this.node.getNode(name).isNodeType(ItemType.NT_RESOURCE) ||
        (this.node.hasProperty("jcr:frozenPrimaryType") && this.node.getNode(name).getProperty("jcr:frozenPrimaryType").getValue().getString().equals(ItemType.NT_RESOURCE)));
  }
}
origin: apache/jackrabbit

/**
 * Tests if adding a property with <code>Node.setProperty(String,
 * Value, int)</code> works with <code>Session.save()</code>
 */
public void testNewValuePropertySessionWithPropertyType() throws Exception {
  testNode.setProperty(propertyName1, v1, PropertyType.STRING);
  superuser.save();
  assertEquals("Setting property with Node.setProperty(String, Value, int) and Session.save() not working",
      v1,
      testNode.getProperty(propertyName1).getValue());
}
origin: apache/jackrabbit

/**
 * Tests if adding a property with <code>Node.setProperty(String,
 * Value, int)</code> works with <code>parentNode.save()</code>
 */
public void testNewValuePropertyParentWithPropertyType() throws Exception {
  testNode.setProperty(propertyName1, v1, PropertyType.STRING);
  testRootNode.getSession().save();
  assertEquals("Setting property with Node.setProperty(String, Value, int) and parentNode.save() not working",
      v1,
      testNode.getProperty(propertyName1).getValue());
}
origin: info.magnolia/magnolia-module-forum

private void renameObsoleteProperty(Node controlNode, String oldName, String newName) throws RepositoryException {
  if (!controlNode.hasProperty(oldName)) {
    return;
  }
  Property property = controlNode.getProperty(oldName);
  controlNode.setProperty(newName, property.getValue());
  property.remove();
}
origin: apache/jackrabbit

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

  /**
   * Tests equals method of Reference value.
   */
  public void testEquals() throws RepositoryException {
    Property prop2 = referencedNode.getProperty(jcrUUID);
    assertTrue("Incorrect equals method of Reference value.",
        PropertyUtil.equalValues(prop2.getValue(), prop.getValue()));
  }
}
origin: apache/jackrabbit

/**
 * Tests if adding a property with <code>Node.setProperty(String,
 * Value)</code> works with <code>parentNode.save()</code>
 */
public void testNewValuePropertyParent() throws Exception {
  testNode.setProperty(propertyName1, v1);
  testRootNode.getSession().save();
  assertEquals("Setting property with Node.setProperty(String, Value) and parentNode.save() not working",
      v1,
      testNode.getProperty(propertyName1).getValue());
}
origin: info.magnolia/magnolia-core

private boolean isBinary(Node requestedData) throws RepositoryException {
  return requestedData.isNodeType(NodeTypes.Resource.NAME) ||
      (requestedData.hasProperty("jcr:frozenPrimaryType") && requestedData.getProperty("jcr:frozenPrimaryType").getValue().getString().equals(NodeTypes.Resource.NAME));
}
origin: org.onehippo.cms7/hippo-essentials-plugin-gallery-manager

private void copyTemplateTranslations(final Session session, final String sourceKey, final String destinationKey) throws RepositoryException {
  final Node bundles = session.getNode("/hippo:configuration/hippo:translations/hippo:templates");
  for (Node bundle : new NodeIterable(bundles.getNodes())) {
    if (bundle.hasProperty(sourceKey)) {
      bundle.setProperty(destinationKey, bundle.getProperty(sourceKey).getValue());
    } else {
      log.debug("Cannot set translation for template {}, cannot find source {}", destinationKey, sourceKey);
    }
  }
}
origin: apache/jackrabbit

/**
 * Tests if adding a property with <code>Node.setProperty(String,
 * Calendar)</code> works with <code>parentNode.save()</code>
 */
public void testNewCalendarPropertyParent() throws Exception {
  testNode.setProperty(propertyName1, c1);
  testRootNode.getSession().save();
  assertEquals("Setting property with Node.setProperty(String, Calendar) and parentNode.save() not working",
      vf.createValue(c1),
      testNode.getProperty(propertyName1).getValue());
}
origin: org.onehippo.cms7/hippo-cms-dashboard

public String getMethod() {
  try {
    Node node = getNode();
    if (node.hasProperty("hippolog:eventMethod")) {
      return node.getProperty("hippolog:eventMethod").getValue().getString();
    }
  } catch (RepositoryException e) {
    log.error(e.getMessage());
  }
  return null;
}
origin: org.onehippo.cms7/hippo-cms-dashboard

public String getDocument() {
  try {
    Node node = getNode();
    if (node.hasProperty("hippolog:eventDocument")) {
      return node.getProperty("hippolog:eventDocument").getValue().getString();
    }
  } catch (RepositoryException e) {
    log.error(e.getMessage());
  }
  return null;
}
origin: apache/jackrabbit

/**
 * Tests if adding a property with <code>Node.setProperty(String,
 * Calendar)</code> works with <code>Session.save()</code>
 */
public void testNewCalendarPropertySession() throws Exception {
  testNode.setProperty(propertyName1, c1);
  superuser.save();
  assertEquals("Setting property with Node.setProperty(String, Calendar) and Session.save() not working",
      vf.createValue(c1),
      testNode.getProperty(propertyName1).getValue());
}
origin: org.wso2.carbon.registry/org.wso2.carbon.registry.jcr

public Value getValue(String s) throws ItemNotFoundException, RepositoryException {
  if (getNode().getProperty(s) != null) {
    return getNode().getProperty(s).getValue();
  } else {
    return null;
  }
}
origin: info.magnolia/magnolia-core

/**
 * Checks that the given property does not exist and creates it with the given value, logs otherwise.
 */
protected void newProperty(InstallContext ctx, Node node, String propertyName, Object value) throws RepositoryException {
  if (!node.hasProperty(propertyName)) {
    PropertyUtil.setProperty(node, propertyName, value);
  } else {
    final String msg = format("Property \"{0}\" was expected not to exist at {1}, but exists with value \"{2}\" and was going to be created with value \"{3}\".",
        propertyName, node.getPath(), node.getProperty(propertyName).getValue().getString(), value);
    ctx.warn(msg);
  }
}
origin: org.jcrom/jcrom

  @Override
  protected Object doLoadObject(Session session, Mapper mapper) throws Exception {
    if (logger.isLoggable(Level.FINE)) {
      logger.fine("Lazy loading single reference for " + nodePath + " " + propertyName);
    }
    Node node = PathUtils.getNode(nodePath, session);
    return mapper.getReferenceMapper().createReferencedObject(field, node.getProperty(propertyName).getValue(), parentObject, session, objClass, depth, nodeFilter, mapper);
  }
}
javax.jcrPropertygetValue

Javadoc

Returns the value of this property as a Value object.

The object returned is a copy of the stored value and is immutable.

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
  • 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
  • setValue
    Sets the value of this property to the values array. If this property's property type is not constra
  • getDefinition,
  • setValue,
  • getParent,
  • getPath,
  • getNode,
  • getLength,
  • getDouble,
  • 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 plugins for Android Studio
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