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

How to use
getName
method
in
javax.jcr.Property

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

origin: info.magnolia/magnolia-core

  @Override
  public boolean evaluateTyped(Property property) {
    try {
      return !(property.getName().startsWith(NodeTypes.JCR_PREFIX)
          || property.getName().startsWith(NodeTypes.MGNL_PREFIX));
    } catch (RepositoryException e) {
      // either invalid or not accessible to the current user
      return false;
    }
  }
}
origin: apache/jackrabbit

  public boolean evaluate(Object object) {
    try {
      Property p = (Property) object;
      return !ignoredProperties.contains(p.getName());
    }
    catch (RepositoryException ignore) {
      return true;
    }
  }
});
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

  public boolean include(Property property) {
    try {
      return !ignoredProperties.contains(property.getName());
    }
    catch (RepositoryException e) {
      return false;
    }
  }
};
origin: org.apache.sling/org.apache.sling.scripting.javascript

public String jsGet_name() {
  try {
    return property.getName();
  } catch (RepositoryException e) {
    return property.toString();
  }
}
origin: org.fcrepo/fcrepo-kernel-modeshape

  @Override
  public boolean test(final Property prop) {
    try {
      return (prop.getName().equals(JCR_LASTMODIFIED) && !subject.hasProperty(FEDORA_LASTMODIFIED))
          || (prop.getName().equals(JCR_LASTMODIFIEDBY) && !subject.hasProperty(FEDORA_LASTMODIFIEDBY))
          || (prop.getName().equals(JCR_CREATED) && !subject.hasProperty(FEDORA_CREATED))
          || (prop.getName().equals(JCR_CREATEDBY) && !subject.hasProperty(FEDORA_CREATEDBY));
    } catch (final RepositoryException e) {
      throw new RepositoryRuntimeException(e);
    }
  }
}
origin: org.onehippo.cms7/hippo-repository-engine

  protected boolean skip(final Property prop) throws RepositoryException {
    final String primaryNodeTypeName = prop.getParent().getPrimaryNodeType().getName();
    if (primaryNodeTypeName.equals(NT_FACETSEARCH) && HIPPO_COUNT.equals(prop.getName())) {
      return true;
    }
    if (prop.getName().equals(HIPPO_PATHS)) {
      return true;
    }
    return false;
  }
}
origin: info.magnolia/magnolia-core

@Override
public boolean evaluateTyped(Property property) {
  try {
    return !excludedNames.contains(property.getName()) && !excludedTypes.contains(PropertyType.nameFromValue(property.getType()));
  } catch (RepositoryException e) {
    return false;
  }
}
origin: info.magnolia/magnolia-core

  @Override
  public int compare(Property o1, Property o2) {
    try {
      return o1.getName().compareTo(o2.getName());
    } catch (RepositoryException e) {
      throw new RuntimeException(e);
    }
  }
});
origin: apache/jackrabbit

/**
 * Move <code>property</code> to the new <code>parent</code>.
 */
protected void move(Property property, Node parent) throws RepositoryException {
  parent.setProperty(property.getName(), property.getValue());
  property.remove();
}
origin: info.magnolia/magnolia-core

public static Property renameProperty(Property property, String newName) throws RepositoryException {
  // Do nothing if the property already has this name, otherwise we would remove the property
  if (property.getName().equals(newName)) {
    return property;
  }
  Node node = property.getParent();
  Property newProperty = node.setProperty(newName, property.getValue());
  property.remove();
  return newProperty;
}
origin: apache/jackrabbit

/**
 * Test if the name of property created with an expanded name is properly
 * return as standard JCR name.
 * 
 * @throws RepositoryException
 */
public void testExpandedNameItem() throws RepositoryException {
  String propName = getExpandedName(propertyName1);
  Property p = testRootNode.setProperty(propName, getJcrValue(superuser, RepositoryStub.PROP_PROP_VALUE1, RepositoryStub.PROP_PROP_TYPE1, "test"));
  assertEquals(propertyName1, p.getName());
}
origin: Adobe-Consulting-Services/acs-aem-commons

public CurrentEvolutionEntryImpl(Property property, EvolutionConfig config) {
  try {
    this.config = config;
    this.type = EvolutionEntryType.PROPERTY;
    this.name = property.getName();
    this.depth = EvolutionPathUtil.getLastDepthForPath(property.getPath());
    this.path = property.getParent().getName();
    this.value = config.printProperty(property);
  } catch (Exception e) {
    log.error("Could not inititalize VersionEntry", e);
  }
}
origin: info.magnolia/magnolia-core

@Override
protected boolean matchesSafely(Property item) {
  try {
    return propertyNameMatcher.matches(item.getName());
  } catch (RepositoryException e) {
    throw new RuntimeRepositoryException(e);
  }
}
origin: apache/jackrabbit

public void testShallowHoldForOtherSession() throws RepositoryException, NotExecutableException {
  retentionMgr.addHold(testNodePath, getHoldName(), false);
  superuser.save();
  
  // check for other session
  assertNoEffect((Node) otherS.getItem(childN.getPath()), nodeName3, propertyName2);
  assertEffect((Node) otherS.getItem(testNodePath), childN.getName(), childP.getName(), nodeName3, propertyName2);
}
origin: info.magnolia/magnolia-core

public Link(Property property) {
  try {
    setJCRNode(property.getParent());
    setWorkspace(property.getSession().getWorkspace().toString());
    setProperty(property);
    setPropertyName(property.getName());
  } catch (RepositoryException e) {
    throw new RuntimeRepositoryException(e);
  }
}
origin: apache/jackrabbit

public void testPropertyAccessibleAfterSave() throws NotExecutableException, RepositoryException {
  Property p;
  try {
    p = testRootNode.setProperty(propname, "anyValue");
  } catch (RepositoryException e) {
    throw new NotExecutableException();
  }
  // check if p is valid and can be accessed from the parent node.
  String name = p.getName();
  assertEquals("Added property must have the original name", name, propname);
  assertTrue("Accessing the created property again must return the 'same' item.", p.isSame(testRootNode.getProperty(propname)));
}
origin: ModeShape/modeshape

private RestProperty createRestProperty( Session session,
                     Property property,
                     String baseUrl ) throws RepositoryException {
  List<String> values = restPropertyValues(property, baseUrl, session);
  String url = RestHelper.urlFrom(baseUrl, ITEMS_METHOD_NAME, encodedPath(property.getPath()));
  String parentUrl = RestHelper.urlFrom(baseUrl, ITEMS_METHOD_NAME, encodedPath(property.getParent().getPath()));
  boolean multiValued = property.isMultiple();
  return new RestProperty(property.getName(), url, parentUrl, values, multiValued);
}
origin: info.magnolia/magnolia-core

@Test
public void getPropertyOrNull() throws Exception {
  // GIVEN
  final String propertyValue = "value";
  final String propertyName = "myProperty";
  root.setProperty(propertyName, propertyValue);
  // WHEN
  final Property res = PropertyUtil.getPropertyOrNull(root, "myProperty");
  // THEN
  assertEquals("Props Name should be " + propertyName, propertyName, res.getName());
  assertEquals("Props Value should be " + propertyValue, propertyValue, res.getString());
}
origin: info.magnolia/magnolia-core

  @Test
  public void multivalueProperty() throws Exception {
    // GIVEN
    MockNode nuts = new MockNode("nuts");
    String[] multivaluePropertyValue = new String[]{"fakeNutProperty1", "fakeNutProperty2"};
    Property property = nuts.setProperty("fakeNut", multivaluePropertyValue);
    // THEN
    assertThat(nuts, hasProperty(property.getName(), multivaluePropertyValue));
  }
}
origin: info.magnolia/magnolia-core

@Test
public void testPropertyNameIsWrappedAndEncoded() throws Exception {
  MockNode node = new MockNode();
  node.setProperty("<html>", "bla");
  HTMLEscapingNodeWrapper wrapper = new HTMLEscapingNodeWrapper(node, false);
  assertEquals("&lt;html&gt;", wrapper.getProperty("<html>").getName());
}
javax.jcrPropertygetName

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
  • 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
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Table (org.hibernate.mapping)
    A relational table
  • Top Vim 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