本文整理汇总了Java中org.apache.jackrabbit.oak.api.PropertyState.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyState.getValue方法的具体用法?Java PropertyState.getValue怎么用?Java PropertyState.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jackrabbit.oak.api.PropertyState
的用法示例。
在下文中一共展示了PropertyState.getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInstance
import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
/**
* Get or create an instance of privilege bits for a specific property that
* stores privileges.
*
* @param property The property state storing privilege bits information.
* @return an instance of {@code PrivilegeBits}
*/
@Nonnull
public static PrivilegeBits getInstance(@Nullable PropertyState property) {
if (property == null) {
return EMPTY;
}
int size = property.count();
if (size == 1) {
return getInstance(property.getValue(Type.LONG, 0));
} else {
long[] longs = new long[size];
for (int i = 0; i < longs.length; i++) {
longs[i] = property.getValue(Type.LONG, i);
}
return getInstance(longs);
}
}
示例2: getValues
import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
private String[] getValues(String oakName, Type<String> type) {
String[] values = null;
PropertyState property = definition.getProperty(checkNotNull(oakName));
if (property != null) {
int n = property.count();
if (n > 0) {
values = new String[n];
for (int i = 0; i < n; i++) {
values[i] = property.getValue(type, i);
}
} else {
values = NO_STRINGS;
}
}
return values;
}
示例3: apply
import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@Override
public boolean apply(NodeState node) {
if (uuids.length == 0) {
return false;
}
PropertyState uuidProperty = node.getProperty(JCR_UUID);
if (uuidProperty == null) {
return false;
}
String parentUuid = uuidProperty.getValue(Type.STRING);
for (String uuid : uuids) {
if (parentUuid.equals(uuid)) {
return true;
}
}
return false;
}
示例4: getDeclaredSubtypes
import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@Override
public NodeTypeIterator getDeclaredSubtypes() {
List<NodeType> subtypes = Lists.newArrayList();
String oakName = getOakName();
Tree root = definition.getParent();
for (Tree child : root.getChildren()) {
PropertyState supertypes = child.getProperty(JCR_SUPERTYPES);
if (supertypes != null) {
for (String name : supertypes.getValue(Type.NAMES)) {
if (oakName.equals(name)) {
subtypes.add(new NodeTypeImpl(child, mapper));
break;
}
}
}
}
return new NodeTypeIteratorAdapter(subtypes);
}
示例5: insert
import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
private static void insert(NodeBuilder index, String key, String value) {
NodeBuilder k = index.child(key);
ArrayList<String> list = new ArrayList<String>();
list.add(value);
if (k.hasProperty("entry")) {
// duplicate key (to detect duplicate entries)
// this is just set temporarily,
// while trying to add a duplicate entry
PropertyState s = k.getProperty("entry");
for (int i = 0; i < s.count(); i++) {
String r = s.getValue(Type.STRING, i);
list.add(r);
}
}
PropertyState s2 = MultiStringPropertyState.stringProperty("entry", list);
k.setProperty(s2);
}
示例6: addChild
import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@Override
public Tree addChild(String name) {
checkArgument(!isHidden(name));
beforeWrite();
if (!super.hasChild(name)) {
nodeBuilder.setChildNode(name);
PropertyState order = nodeBuilder.getProperty(OAK_CHILD_ORDER);
if (order != null) {
List<String> names = newArrayListWithCapacity(order.count() + 1);
for (String n : order.getValue(NAMES)) {
if (!n.equals(name)) {
names.add(n);
}
}
names.add(name);
nodeBuilder.setProperty(OAK_CHILD_ORDER, names, NAMES);
}
root.updated();
}
return createChild(name);
}
示例7: getValueAsString
import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
/**
* Optimized value access method. Returns the string value of a property
* of a given non-array type. Returns {@code null} if the named property
* does not exist, or is of a different type than given.
*
* @param name property name
* @param type property type
* @return string value of the property, or {@code null}
*/
@CheckForNull
private String getValueAsString(String name, Type<?> type) {
checkArgument(!type.isArray());
Template template = getTemplate();
if (JCR_PRIMARYTYPE.equals(name)) {
PropertyState primary = template.getPrimaryType();
if (primary != null) {
if (type == NAME) {
return primary.getValue(NAME);
} else {
return null;
}
}
} else if (JCR_MIXINTYPES.equals(name)
&& template.getMixinTypes() != null) {
return null;
}
PropertyTemplate propertyTemplate =
template.getPropertyTemplate(name);
if (propertyTemplate == null
|| propertyTemplate.getType() != type) {
return null;
}
Segment segment = getSegment();
int ids = 1 + propertyTemplate.getIndex();
if (template.getChildName() != Template.ZERO_CHILD_NODES) {
ids++;
}
return segment.readString(segment.readRecordId(getOffset(0, ids)));
}
示例8: getPrincipalName
import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@Nonnull
String getPrincipalName() throws RepositoryException {
if (principalName == null) {
PropertyState pNameProp = tree.getProperty(REP_PRINCIPAL_NAME);
if (pNameProp != null) {
principalName = pNameProp.getValue(STRING);
} else {
String msg = "Authorizable without principal name " + id;
log.warn(msg);
throw new RepositoryException(msg);
}
}
return principalName;
}
示例9: getNamespaceURI
import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
public static String getNamespaceURI(Tree root, String prefix) {
if (prefix.isEmpty()) {
return prefix;
}
if (isValidPrefix(prefix)) {
PropertyState property = getNamespaceTree(root).getProperty(prefix);
if (property != null && property.getType() == STRING) {
return property.getValue(STRING);
}
}
return null;
}
示例10: getDisabledReason
import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@Override
public String getDisabledReason() throws RepositoryException {
PropertyState disabled = getTree().getProperty(REP_DISABLED);
if (disabled != null) {
return disabled.getValue(STRING);
} else {
return null;
}
}
示例11: OrderedPropertyIndexEditor
import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
public OrderedPropertyIndexEditor(NodeBuilder definition, NodeState root,
IndexUpdateCallback callback) {
super(definition, root, callback);
// configuring propertyNames
Set<String> pns = null;
PropertyState names = definition.getProperty(IndexConstants.PROPERTY_NAMES);
if (names != null) {
String value = names.getValue(Type.NAME, 0);
if (Strings.isNullOrEmpty(value)) {
LOG.warn("Empty value passed as propertyNames. Index not properly configured. Ignoring.");
} else {
if (names.isArray() && names.count() > 1) {
LOG.debug("Only single value supported. '{}' only will be used.", value);
}
pns = Collections.singleton(value);
this.properlyConfigured = true;
}
}
this.propertyNames = pns;
// configuring direction
String propertyDirection = definition.getString(OrderedIndex.DIRECTION);
if (propertyDirection == null) {
// LOG.debug("Using default direction for sorting: {}", this.direction);
} else {
OrderDirection dir = OrderDirection.fromString(propertyDirection);
if (dir == null) {
LOG.warn("An unknown direction has been specified for sorting: '{}'. Using default one. {}",
propertyDirection, this.direction);
} else {
this.direction = dir;
}
}
// initialising the stopwatch.
swl = new StopwatchLogger(OrderedPropertyIndexEditor.class);
}
示例12: getOakURIOrNull
import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@CheckForNull
protected synchronized String getOakURIOrNull(String prefix) {
if (prefix.isEmpty()) {
return prefix;
}
PropertyState mapping = namespaces.getProperty(prefix);
if (mapping != null && mapping.getType() == STRING) {
return mapping.getValue(STRING);
}
return null;
}
示例13: getAuthorizableId
import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@CheckForNull
public static String getAuthorizableId(@Nonnull Tree authorizableTree) {
checkNotNull(authorizableTree);
if (UserUtil.isType(authorizableTree, AuthorizableType.AUTHORIZABLE)) {
PropertyState idProp = authorizableTree.getProperty(UserConstants.REP_AUTHORIZABLE_ID);
if (idProp != null) {
return idProp.getValue(STRING);
} else {
return Text.unescapeIllegalJcrChars(authorizableTree.getName());
}
}
return null;
}
示例14: getValue
import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
private String getValue(String oakName, Type<String> type) {
PropertyState property = definition.getProperty(checkNotNull(oakName));
if (property != null) {
return property.getValue(type);
} else {
return null;
}
}
示例15: getBoolean
import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@Override
public boolean getBoolean(String name) {
PropertyState property = getProperty(name);
return property != null
&& property.getType() == BOOLEAN
&& property.getValue(BOOLEAN);
}