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

How to use
getDefinition
method
in
javax.jcr.Property

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

origin: org.onehippo.cms7/hippo-repository-connector

/**
 * @inheritDoc
 */
public PropertyDefinition getDefinition() throws RepositoryException {
  return property.getDefinition();
}
origin: org.apache.sling/org.apache.sling.scripting.javascript

public Object jsGet_definition() {
  try {
    return property.getDefinition();
  } catch (RepositoryException re) {
    return Undefined.instance;
  }
}
origin: info.magnolia/magnolia-core

@Override
public PropertyDefinition getDefinition() throws RepositoryException {
  return getWrappedProperty().getDefinition();
}
origin: org.apache.jackrabbit.vault/org.apache.jackrabbit.vault

/**
 * {@inheritDoc}
 */
@Override
public void onProperty(Property prop, int level) throws RepositoryException {
  if (ignored.contains(prop.getName()) && prop.getDefinition().isProtected()) {
    return;
  }
  props.add(prop);
}
origin: org.apache.sling/org.apache.sling.servlets.post

public boolean isPropertyMandatory(final Object node, final String name)
throws PersistenceException {
  try {
    final Property prop = ((Node)node).getProperty(name);
    return prop.getDefinition().isMandatory();
  } catch ( final RepositoryException re) {
    throw new PersistenceException(re.getMessage(), re);
  }
}
origin: org.apache.sling/org.apache.sling.servlets.post

public boolean isPropertyMultiple(final Object node, final String name)
throws PersistenceException {
  try {
    final Property prop = ((Node)node).getProperty(name);
    return prop.getDefinition().isMultiple();
  } catch ( final RepositoryException re) {
    throw new PersistenceException(re.getMessage(), re);
  }
}
origin: org.apache.jackrabbit/jackrabbit-core

private boolean isProtected(ItemImpl item) throws RepositoryException {
  ItemDefinition def;
  if (item.isNode()) {
    def = ((Node) item).getDefinition();
  } else {
    def = ((Property) item).getDefinition();
  }
  return def.isProtected();
}
origin: apache/jackrabbit

protected void setUp() throws Exception {
  super.setUp();
  childNodeTypeName = getProperty("nodetype");
  // set the property
  p = versionableNode.setProperty(propertyName1, initialPropValue);
  // assert that property has the proper opv-behaviour
  PropertyDefinition pd = p.getDefinition();
  if (pd.getOnParentVersion() != OPVAction) {
    fail("JCR Property at '"+p.getPath()+"' does not have the required OnParentVersion "+OnParentVersionAction.nameFromValue(OPVAction)+" definition.");
  }
  testRootNode.getSession().save();
}
origin: apache/jackrabbit

/** {@inheritDoc} */
public RemotePropertyDefinition getDefinition()
    throws RepositoryException, RemoteException {
  try {
    return getFactory().getRemotePropertyDefinition(property.getDefinition());
  } catch (RepositoryException ex) {
    throw getRepositoryException(ex);
  }
}
origin: org.onehippo.cms7/hippo-repository-engine

protected Value[] getValues(final Property prop) throws RepositoryException {
  if (prop.getDefinition().isMultiple()) {
    return prop.getValues();
  } else {
    return new Value[] { prop.getValue() };
  }
}
origin: org.onehippo.cms7/hippo-repository-engine

private List<String> getDeletablePropertyNames(final Node node) throws RepositoryException {
  final List<String> names = new ArrayList<>();
  for (Property property : new PropertyIterable(node.getProperties())) {
    final ItemDefinition definition = property.getDefinition();
    final String name = property.getName();
    if (!definition.isProtected() && !definition.isMandatory() && !isKnownDerivedPropertyName(name)) {
      names.add(name);
    }
  }
  return names;
}
origin: org.apache.jackrabbit/jackrabbit-jcr-commons

  /**
   * @see org.apache.jackrabbit.commons.predicate.DepthPredicate#matches(javax.jcr.Item)
   */
  @Override
  protected boolean matches(Item item) throws RepositoryException {
    if (item.isNode()) {
      return ((Node) item).getDefinition().isMandatory() == isMandatory;
    }
    return ((Property) item).getDefinition().isMandatory() == isMandatory;
  }
}
origin: org.apache.jackrabbit/com.springsource.org.apache.jackrabbit.commons

  /**
   * @see org.apache.jackrabbit.commons.predicate.DepthPredicate#matches(javax.jcr.Item)
   */
  protected boolean matches(Item item) throws RepositoryException {
    if (item.isNode()) {
      return ((Node) item).getDefinition().isMandatory() == isMandatory;
    }
    return ((Property) item).getDefinition().isMandatory() == isMandatory;
  }
}
origin: org.onehippo.cms7/hippo-repository-api

protected void removeProperties(final Node node) throws RepositoryException {
  for (Property property : new PropertyIterable(node.getProperties())) {
    if (!property.getDefinition().isProtected()) {
      property.remove();
    }
  }
}
origin: org.apache.jackrabbit.vault/org.apache.jackrabbit.vault

public boolean matches(Item item) throws RepositoryException {
  if (item.isNode()) {
    return ((Node) item).getDefinition().isMandatory() == isMandatory;
  } else {
    return ((Property) item).getDefinition().isMandatory() == isMandatory;
  }
}
origin: apache/jackrabbit

  /**
   * @see org.apache.jackrabbit.commons.predicate.DepthPredicate#matches(javax.jcr.Item)
   */
  @Override
  protected boolean matches(Item item) throws RepositoryException {
    if (item.isNode()) {
      return ((Node) item).getDefinition().isMandatory() == isMandatory;
    }
    return ((Property) item).getDefinition().isMandatory() == isMandatory;
  }
}
origin: info.magnolia/magnolia-core

@Test
public void testDefaultPropertyDefinition() throws Exception {
  // GIVEN
  // WHEN
  Property property = new MockProperty("test", new MockValue("value"), null);
  // THEN
  assertThat(property.getDefinition(), instanceOf(MockPropertyDefinition.class));
  assertThat(property.getDefinition().isMultiple(), is(false));
  assertThat(property.getDefinition().isMandatory(), is(false));
}
origin: apache/jackrabbit-oak

  public void testEmptyValues() throws Exception {
    superuser.importXML(targetPath, getImportStream(), ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
    superuser.save();

    Node n = superuser.getNode(targetPath).getNode(nodeName4);
    Property p = n.getNode(nodeName3).getProperty("test:multiProperty");

    assertTrue(p.isMultiple());
    assertTrue(p.getDefinition().isMultiple());
    Assert.assertArrayEquals(new String[0], p.getValues());
  }
}
origin: apache/jackrabbit-oak

public void testSingleValues() throws Exception {
  superuser.importXML(targetPath, getImportStream(), ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
  superuser.save();
  Node n = superuser.getNode(targetPath).getNode(nodeName4);
  Property p = n.getNode(nodeName1).getProperty("test:multiProperty");
  assertTrue(p.isMultiple());
  assertTrue(p.getDefinition().isMultiple());
  Assert.assertArrayEquals(new Value[]{vf.createValue("v1")}, p.getValues());
}
origin: apache/jackrabbit-oak

public void testMultiValues() throws Exception {
  superuser.importXML(targetPath, getImportStream(), ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
  superuser.save();
  Node n = superuser.getNode(targetPath).getNode(nodeName4);
  Property p = n.getNode(nodeName2).getProperty("test:multiProperty");
  assertTrue(p.isMultiple());
  assertTrue(p.getDefinition().isMultiple());
  Value[] expected = new Value[] {vf.createValue("v1"), vf.createValue("v2")};
  Assert.assertArrayEquals(expected, p.getValues());
}
javax.jcrPropertygetDefinition

Javadoc

Returns the property definition that applies to this property. In some cases there may appear to be more than one definition that could apply to this node. However, it is assumed that upon creation or change of this property, a single particular definition is chosen by the implementation. It is that definition that this method returns. How this governing definition is selected upon property creation or change from among others which may have been applicable is an implementation issue and is not covered by this specification.

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

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • Permission (java.security)
    Legacy security code; do not use.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • CodeWhisperer alternatives
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