how to get array values of a node property in jcr

浪尽此生 提交于 2019-12-04 09:13:52

From the Node, you can get the references property. And then call getValues to the reference values. From there, just take the first. Something like

public String getFirstReference(Node node) throws RepositoryException {
  Property references = node.getProperty("references");     
  Value[] values = references.getValues();
  return values[0].getString();     
}
Siddharth Rawat
Property nProp = node.getProperty("references");
Value[] values = propertyNode.getValues();
for (Value v : values) {
    System.out.println("Property Name = "+nProp.getName()+" ; Property Value= "+v.getString());
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!