当前位置: 首页>>代码示例>>Java>>正文


Java PropertyState.getName方法代码示例

本文整理汇总了Java中org.apache.jackrabbit.oak.api.PropertyState.getName方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyState.getName方法的具体用法?Java PropertyState.getName怎么用?Java PropertyState.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.jackrabbit.oak.api.PropertyState的用法示例。


在下文中一共展示了PropertyState.getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TokenInfoImpl

import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
private TokenInfoImpl(NodeUtil tokenNode, String token, String userId) {
    this.token = token;
    this.tokenPath = tokenNode.getTree().getPath();
    this.userId = userId;

    expirationTime = getExpirationTime(tokenNode, Long.MIN_VALUE);
    key = tokenNode.getString(TOKEN_ATTRIBUTE_KEY, null);

    mandatoryAttributes = new HashMap<String, String>();
    publicAttributes = new HashMap<String, String>();
    for (PropertyState propertyState : tokenNode.getTree().getProperties()) {
        String name = propertyState.getName();
        String value = propertyState.getValue(STRING);
        if (RESERVED_ATTRIBUTES.contains(name)) {
            continue;
        }
        if (isMandatoryAttribute(name)) {
            mandatoryAttributes.put(name, value);
        } else if (isInfoAttribute(name)) {
            // info attribute
            publicAttributes.put(name, value);
        } // else: jcr specific property
    }
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:25,代码来源:TokenProviderImpl.java

示例2: getNames

import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@Override
public Iterator<String> getNames(String relPath) throws RepositoryException {
    String oakPath = getOakPath(relPath);
    Tree tree = getTree();
    TreeLocation location = getLocation(tree, oakPath);
    Tree parent = location.getTree();
    if (parent != null && Text.isDescendantOrEqual(tree.getPath(), parent.getPath())) {
        List<String> l = new ArrayList<String>();
        for (PropertyState property : parent.getProperties()) {
            String propName = property.getName();
            if (isAuthorizableProperty(tree, location.getChild(propName), false)) {
                l.add(namePathMapper.getJcrName(propName));
            }
        }
        return l.iterator();
    } else {
        throw new RepositoryException("Relative path " + relPath + " refers to items outside of scope of authorizable.");
    }
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:20,代码来源:AuthorizablePropertiesImpl.java

示例3: buildIndexNode

import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
public static void buildIndexNode(NodeBuilder namespaces) {
    // initialize prefix and URI sets with the defaults namespace
    // that's not stored along with the other mappings
    Set<String> prefixes = newHashSet("");
    Set<String> uris = newHashSet("");
    Map<String, String> reverse = new HashMap<String, String>();

    for (PropertyState property : namespaces.getProperties()) {
        String prefix = property.getName();
        if (STRING.equals(property.getType()) && isValidPrefix(prefix)) {
            prefixes.add(prefix);
            String uri = property.getValue(STRING);
            uris.add(uri);
            reverse.put(uri, prefix);
        }
    }

    NodeBuilder data = namespaces.setChildNode(REP_NSDATA);
    data.setProperty(JCR_PRIMARYTYPE, NodeTypeConstants.NT_REP_UNSTRUCTURED, Type.NAME);
    data.setProperty(REP_PREFIXES, prefixes, Type.STRINGS);
    data.setProperty(REP_URIS, uris, Type.STRINGS);
    for (Entry<String, String> e : reverse.entrySet()) {
        data.setProperty(encodeUri(e.getKey()), e.getValue());
    }
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:26,代码来源:Namespaces.java

示例4: propertyDeleted

import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@Override
public void propertyDeleted(PropertyState before) throws CommitFailedException {
    if (authorizableType == null) {
        return;
    }

    String name = before.getName();
    if (REP_PASSWORD.equals(name) || REP_PRINCIPAL_NAME.equals(name) || REP_AUTHORIZABLE_ID.equals(name)) {
        String msg = "Authorizable property " + name + " may not be removed.";
        throw constraintViolation(25, msg);
    }
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:13,代码来源:UserValidator.java

示例5: getNamespaceMap

import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
public static Map<String, String> getNamespaceMap(Tree root) {
    Map<String, String> map = newHashMap();
    map.put("", ""); // default namespace, not included in tree

    Tree namespaces = getNamespaceTree(root);
    for (PropertyState property : namespaces.getProperties()) {
        String prefix = property.getName();
        if (STRING.equals(property.getType()) && isValidPrefix(prefix)) {
            map.put(prefix, property.getValue(STRING));
        }
    }

    return map;
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:15,代码来源:Namespaces.java

示例6: matches

import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@Override
public boolean matches(@Nonnull Tree tree, @Nullable PropertyState property) {
    String name = (property != null) ? property.getName() : tree.getName();
    String prefix = Text.getNamespacePrefix(name);
    if (!prefix.isEmpty()) {
        for (String p : prefixes) {
            if (prefix.equals(p)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:14,代码来源:PrefixPattern.java

示例7: propertyAdded

import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@Override
public void propertyAdded(PropertyState after) throws CommitFailedException {
    String name = after.getName();
    if (!TreeConstants.OAK_CHILD_ORDER.equals(name)) {
        checkPermissions(parentAfter, after, Permissions.ADD_PROPERTY);
    }
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:8,代码来源:PermissionValidator.java

示例8: propertyChanged

import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@Override
public void propertyChanged(PropertyState before, PropertyState after) throws CommitFailedException {
    String name = after.getName();
    if (TreeConstants.OAK_CHILD_ORDER.equals(name)) {
        String childName = ChildOrderDiff.firstReordered(before, after);
        if (childName != null) {
            checkPermissions(parentAfter, false, Permissions.MODIFY_CHILD_NODE_COLLECTION);
        } // else: no re-order but only internal update
    } else if (isImmutableProperty(name)) {
        // parent node has been removed and and re-added as
        checkPermissions(parentAfter, false, Permissions.ADD_NODE|Permissions.REMOVE_NODE);
    } else {
        checkPermissions(parentAfter, after, Permissions.MODIFY_PROPERTY);
    }
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:16,代码来源:PermissionValidator.java

示例9: Template

import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
Template(NodeState state) {
    PropertyState primary = null;
    PropertyState mixins = null;
    List<PropertyTemplate> templates = Lists.newArrayList();

    for (PropertyState property : state.getProperties()) {
        String name = property.getName();
        Type<?> type = property.getType();
        if ("jcr:primaryType".equals(name) && type == Type.NAME) {
            primary = property;
        } else if ("jcr:mixinTypes".equals(name) && type == Type.NAMES) {
            mixins = property;
        } else {
            templates.add(new PropertyTemplate(property));
        }
    }

    this.primaryType = primary;
    this.mixinTypes = mixins;
    this.properties =
            templates.toArray(new PropertyTemplate[templates.size()]);
    Arrays.sort(properties);

    long count = state.getChildNodeCount(2);
    if (count == 0) {
        childName = ZERO_CHILD_NODES;
    } else if (count == 1) {
        childName = state.getChildNodeNames().iterator().next();
        checkState(childName != null && !childName.equals(MANY_CHILD_NODES));
    } else {
        childName = MANY_CHILD_NODES;
    }
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:34,代码来源:Template.java

示例10: getRestrictionProperties

import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@Nonnull
private Map<String, PropertyState> getRestrictionProperties(Tree aceTree) {
    Tree rTree = getRestrictionsTree(aceTree);
    Map<String, PropertyState> restrictionProperties = new HashMap<String, PropertyState>();
    for (PropertyState property : rTree.getProperties()) {
        String name = property.getName();
        if (isRestrictionProperty(name)) {
            restrictionProperties.put(name, property);
        }
    }
    return restrictionProperties;
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:13,代码来源:AbstractRestrictionProvider.java

示例11: propertyAdded

import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@Override
public void propertyAdded(PropertyState after) throws CommitFailedException {
    String prefix = after.getName();
    // ignore jcr:primaryType
    if (JCR_PRIMARYTYPE.equals(prefix)) {
        return;
    }

    if (namespaces.hasProperty(prefix)) {
        throw new CommitFailedException(CommitFailedException.NAMESPACE, 1,
                "Namespace mapping already registered: " + prefix);
    } else if (isValidPrefix(prefix)) {
        if (after.isArray() || !STRING.equals(after.getType())) {
            throw new CommitFailedException(
                    CommitFailedException.NAMESPACE, 2,
                    "Invalid namespace mapping: " + prefix);
        } else if (prefix.toLowerCase(Locale.ENGLISH).startsWith("xml")) {
            throw new CommitFailedException(
                    CommitFailedException.NAMESPACE, 3,
                    "XML prefixes are reserved: " + prefix);
        } else if (containsValue(namespaces, after.getValue(STRING))) {
            throw modificationNotAllowed(prefix);
        }
    } else {
        throw new CommitFailedException(CommitFailedException.NAMESPACE, 4,
                "Not a valid namespace prefix: " + prefix);
    }
    modified = true;
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:30,代码来源:NamespaceEditor.java

示例12: applyResolution

import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
private void applyResolution(Resolution resolution, ConflictType conflictType, PropertyState ours) {
    String name = ours.getName();
    NodeBuilder conflictMarker = getConflictMarker(conflictType);
    if (resolution == Resolution.OURS) {
        if (DELETE_CHANGED_PROPERTY == conflictType) {
            target.removeProperty(name);
        }
        else {
            target.setProperty(ours);
        }

    }
    conflictMarker.removeProperty(name);
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:15,代码来源:MergingNodeStateDiff.java

示例13: propertyDeleted

import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@Override
public void propertyDeleted(PropertyState before)
        throws CommitFailedException {
    String name = before.getName();
    if (checkThisNode && effective.isMandatoryProperty(name)) {
        constraintViolation(
                22, "Mandatory property " + name + " can not be removed");
    }
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:10,代码来源:TypeEditor.java

示例14: propertyDeleted

import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
@Override
public void propertyDeleted(PropertyState before) {
    String name = before.getName();
    typeChanged = typeChanged || isTypeProperty(name);
    if (getPropertyNames().contains(name)) {
        beforeKeys = addValueKeys(beforeKeys, before);
    }
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:9,代码来源:PropertyIndexEditor.java

示例15: checkRemoveProperty

import org.apache.jackrabbit.oak.api.PropertyState; //导入方法依赖的package包/类
public void checkRemoveProperty(PropertyState property) throws RepositoryException {
    PropertyDefinition definition = getDefinition(property);
    if (definition.isProtected()) {
        return;
    }

    if (!definition.getDeclaringNodeType().canRemoveProperty(property.getName())) {
        throw new ConstraintViolationException("Cannot remove property '" + property.getName() + '\'');
    }
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:11,代码来源:EffectiveNodeType.java


注:本文中的org.apache.jackrabbit.oak.api.PropertyState.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。