jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1363452 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type: DefBuilderFactory.java NodeDefinitionTemplateImpl.java NodeTypeTemplateImpl.java PropertyDefinitionTemplateImpl.java
Date Thu, 19 Jul 2012 18:16:11 GMT
Author: jukka
Date: Thu Jul 19 18:16:10 2012
New Revision: 1363452

URL: http://svn.apache.org/viewvc?rev=1363452&view=rev
Log:
OAK-66: JCR Node Type Management

Add type templates based on the CND reader code from jcr-commons

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/DefBuilderFactory.java
  (with props)
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeDefinitionTemplateImpl.java
  (with props)
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeTemplateImpl.java
  (with props)
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/PropertyDefinitionTemplateImpl.java
  (with props)

Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/DefBuilderFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/DefBuilderFactory.java?rev=1363452&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/DefBuilderFactory.java
(added)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/DefBuilderFactory.java
Thu Jul 19 18:16:10 2012
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.plugins.type;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.NodeTypeTemplate;
+
+import org.apache.jackrabbit.commons.cnd.DefinitionBuilderFactory;
+
+class DefBuilderFactory extends
+        DefinitionBuilderFactory<NodeTypeTemplate, Map<String, String>> {
+
+    private Map<String, String> namespaces = new HashMap<String, String>();
+
+    @Override
+    public NodeTypeTemplateImpl newNodeTypeDefinitionBuilder()
+            throws RepositoryException {
+        return new NodeTypeTemplateImpl() {
+            @Override
+            protected NodeType getNodeType(String name) {
+                // TODO Auto-generated method stub
+                return null;
+            }
+            @Override
+            protected Value createValue(String value)
+                    throws RepositoryException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+        };
+    }
+
+    @Override
+    public Map<String, String> getNamespaceMapping() {
+        return namespaces;
+    }
+
+    @Override
+    public void setNamespaceMapping(Map<String, String> namespaces) {
+        this.namespaces = namespaces;
+    }
+
+    @Override
+    public void setNamespace(String prefix, String uri) {
+        namespaces.put(prefix, uri);
+    }
+
+}

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/DefBuilderFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeDefinitionTemplateImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeDefinitionTemplateImpl.java?rev=1363452&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeDefinitionTemplateImpl.java
(added)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeDefinitionTemplateImpl.java
Thu Jul 19 18:16:10 2012
@@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.plugins.type;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.nodetype.NodeDefinitionTemplate;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.NodeTypeTemplate;
+
+import org.apache.jackrabbit.commons.cnd.DefinitionBuilderFactory.AbstractNodeDefinitionBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+abstract class NodeDefinitionTemplateImpl
+        extends AbstractNodeDefinitionBuilder<NodeTypeTemplate>
+        implements NodeDefinitionTemplate {
+
+    private static final Logger log =
+            LoggerFactory.getLogger(NodeDefinitionTemplateImpl.class);
+
+    private String defaultPrimaryTypeName = null;
+
+    private String[] requiredPrimaryTypeNames = null;
+
+    protected NodeType getNodeType(String name) throws RepositoryException {
+        throw new UnsupportedRepositoryOperationException();
+    }
+
+    @Override
+    public void build() {
+        // do nothing by default
+    }
+
+    @Override
+    public NodeType getDeclaringNodeType() {
+        return null;
+    }
+
+    @Override
+    public void setDeclaringNodeType(String name) {
+        // ignore
+    }
+
+    @Override
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public boolean isAutoCreated() {
+        return autocreate;
+    }
+
+    @Override
+    public void setAutoCreated(boolean autocreate) {
+        this.autocreate = autocreate;
+    }
+
+    @Override
+    public boolean isProtected() {
+        return isProtected;
+    }
+
+    @Override
+    public void setProtected(boolean isProtected) {
+        this.isProtected = isProtected;
+    }
+
+    @Override
+    public boolean isMandatory() {
+        return isMandatory;
+    }
+
+    @Override
+    public void setMandatory(boolean isMandatory) {
+        this.isMandatory = isMandatory;
+    }
+
+    @Override
+    public int getOnParentVersion() {
+        return onParent;
+    }
+
+    @Override
+    public void setOnParentVersion(int onParent) {
+        this.onParent = onParent;
+    }
+
+    @Override
+    public boolean allowsSameNameSiblings() {
+        return allowSns;
+    }
+
+    @Override
+    public void setSameNameSiblings(boolean allowSns) {
+        this.allowSns = allowSns;
+    }
+
+    @Override
+    public void setAllowsSameNameSiblings(boolean allowSns) {
+        setSameNameSiblings(allowSns);
+    }
+
+    @Override
+    public NodeType getDefaultPrimaryType() {
+        if (defaultPrimaryTypeName != null) {
+            try {
+                return getNodeType(defaultPrimaryTypeName);
+            } catch (RepositoryException e) {
+                log.warn("Unable to access default primary type "
+                        + defaultPrimaryTypeName + " of " + name, e);
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public String getDefaultPrimaryTypeName() {
+        return defaultPrimaryTypeName;
+    }
+
+    @Override
+    public void setDefaultPrimaryTypeName(String name) {
+        this.defaultPrimaryTypeName  = name;
+    }
+
+    @Override
+    public void setDefaultPrimaryType(String name) {
+        setDefaultPrimaryTypeName(name);
+    }
+
+    @Override
+    public NodeType[] getRequiredPrimaryTypes() {
+        if (requiredPrimaryTypeNames == null) {
+            return new NodeType[0];
+        } else {
+            List<NodeType> types =
+                    new ArrayList<NodeType>(requiredPrimaryTypeNames.length);
+            for (int i = 0; i < requiredPrimaryTypeNames.length; i++) {
+                try {
+                    types.add(getNodeType(requiredPrimaryTypeNames[i]));
+                } catch (RepositoryException e) {
+                    log.warn("Unable to required primary primary type "
+                            + requiredPrimaryTypeNames[i] + " of " + name, e);
+                }
+            }
+            return types.toArray(new NodeType[types.size()]);
+        }
+    }
+
+    @Override
+    public String[] getRequiredPrimaryTypeNames() {
+        return requiredPrimaryTypeNames;
+    }
+
+    @Override
+    public void setRequiredPrimaryTypeNames(String[] names) {
+        this.requiredPrimaryTypeNames = names;
+    }
+
+    @Override
+    public void addRequiredPrimaryType(String name) {
+        if (requiredPrimaryTypeNames == null) {
+            requiredPrimaryTypeNames = new String[] { name };
+        } else {
+            String[] names = new String[requiredPrimaryTypeNames.length + 1];
+            System.arraycopy(requiredPrimaryTypeNames, 0, names, 0, requiredPrimaryTypeNames.length);
+            names[requiredPrimaryTypeNames.length] = name;
+            requiredPrimaryTypeNames = names;
+        }
+
+    }
+
+}
\ No newline at end of file

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeDefinitionTemplateImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeTemplateImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeTemplateImpl.java?rev=1363452&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeTemplateImpl.java
(added)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeTemplateImpl.java
Thu Jul 19 18:16:10 2012
@@ -0,0 +1,232 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.plugins.type;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.nodetype.NodeDefinition;
+import javax.jcr.nodetype.NodeDefinitionTemplate;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.NodeTypeDefinition;
+import javax.jcr.nodetype.NodeTypeTemplate;
+import javax.jcr.nodetype.PropertyDefinition;
+import javax.jcr.nodetype.PropertyDefinitionTemplate;
+
+import org.apache.jackrabbit.commons.cnd.DefinitionBuilderFactory.AbstractNodeTypeDefinitionBuilder;
+
+abstract class NodeTypeTemplateImpl
+    extends AbstractNodeTypeDefinitionBuilder<NodeTypeTemplate>
+    implements NodeTypeTemplate {
+
+    private String primaryItemName = null;
+
+    private String[] superTypeNames = new String[0];
+
+    private final List<PropertyDefinitionTemplate> propertyDefinitionTemplates =
+            new ArrayList<PropertyDefinitionTemplate>();
+
+    private final List<NodeDefinitionTemplate> nodeDefinitionTemplates =
+            new ArrayList<NodeDefinitionTemplate>();
+
+    public NodeTypeTemplateImpl() {
+    }
+
+    public NodeTypeTemplateImpl(NodeTypeDefinition ntd) {
+        setName(ntd.getName());
+        setAbstract(ntd.isAbstract());
+        setMixin(ntd.isMixin());
+        setOrderableChildNodes(ntd.hasOrderableChildNodes());
+        setQueryable(ntd.isQueryable());
+        setPrimaryItemName(ntd.getPrimaryItemName());
+        setDeclaredSuperTypeNames(ntd.getDeclaredSupertypeNames());
+
+        for (PropertyDefinition pd : getDeclaredPropertyDefinitions()) {
+            PropertyDefinitionTemplateImpl pdt = newPropertyDefinitionBuilder();
+            pdt.setDeclaringNodeType(pd.getDeclaringNodeType().getName());
+            pdt.setName(pd.getName());
+            pdt.setProtected(pd.isProtected());
+            pdt.setMandatory(pd.isMandatory());
+            pdt.setAutoCreated(pd.isAutoCreated());
+            pdt.setOnParentVersion(pd.getOnParentVersion());
+            pdt.setMultiple(pd.isMultiple());
+            pdt.setRequiredType(pd.getRequiredType());
+            pdt.setDefaultValues(pd.getDefaultValues());
+            pdt.setValueConstraints(pd.getValueConstraints());
+            pdt.setFullTextSearchable(pd.isFullTextSearchable());
+            pdt.setAvailableQueryOperators(pd.getAvailableQueryOperators());
+            pdt.setQueryOrderable(pd.isQueryOrderable());
+            pdt.build();
+        }
+
+        for (NodeDefinition nd : getDeclaredChildNodeDefinitions()) {
+            NodeDefinitionTemplateImpl ndt = newNodeDefinitionBuilder();
+            ndt.setDeclaringNodeType(nd.getDeclaringNodeType().getName());
+            ndt.setName(nd.getName());
+            ndt.setProtected(nd.isProtected());
+            ndt.setMandatory(nd.isMandatory());
+            ndt.setAutoCreated(nd.isAutoCreated());
+            ndt.setOnParentVersion(nd.getOnParentVersion());
+            ndt.setSameNameSiblings(nd.allowsSameNameSiblings());
+            ndt.setDefaultPrimaryTypeName(nd.getDefaultPrimaryTypeName());
+            ndt.setRequiredPrimaryTypeNames(nd.getRequiredPrimaryTypeNames());
+            ndt.build();
+        }
+    }
+
+    protected abstract Value createValue(String value)
+            throws RepositoryException;
+
+    protected abstract NodeType getNodeType(String name);
+
+    @Override
+    public NodeTypeTemplate build() {
+        return this;
+    }
+
+    @Override
+    public PropertyDefinitionTemplateImpl newPropertyDefinitionBuilder() {
+        return new PropertyDefinitionTemplateImpl() {
+            @Override
+            protected Value createValue(String value)
+                    throws RepositoryException {
+                return NodeTypeTemplateImpl.this.createValue(value);
+            }
+            @Override
+            public void build() {
+                getPropertyDefinitionTemplates().add(this);
+            }
+        };
+    }
+
+    @Override
+    public NodeDefinitionTemplateImpl newNodeDefinitionBuilder() {
+        return new NodeDefinitionTemplateImpl() {
+            @Override
+            protected NodeType getNodeType(String name) {
+                return NodeTypeTemplateImpl.this.getNodeType(name);
+            }
+            @Override
+            public void build() {
+                getNodeDefinitionTemplates().add(this);
+            }
+        };
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public boolean isAbstract() {
+        return isAbstract;
+    }
+
+    @Override
+    public void setAbstract(boolean abstractStatus) {
+        this.isAbstract = abstractStatus;
+    }
+
+    @Override
+    public boolean isMixin() {
+        return isMixin;
+    }
+
+    @Override
+    public void setMixin(boolean mixin) {
+        this.isMixin = mixin;
+    }
+
+    @Override
+    public boolean hasOrderableChildNodes() {
+        return isOrderable ;
+    }
+
+    @Override
+    public void setOrderableChildNodes(boolean orderable) {
+        this.isOrderable = orderable;
+    }
+
+    @Override
+    public boolean isQueryable() {
+        return queryable;
+    }
+
+    @Override
+    public void setQueryable(boolean queryable) {
+        this.queryable = queryable;
+    }
+
+    @Override
+    public String getPrimaryItemName() {
+        return primaryItemName ;
+    }
+
+    @Override
+    public void setPrimaryItemName(String name) {
+        this.primaryItemName = name;
+    }
+
+    @Override
+    public String[] getDeclaredSupertypeNames() {
+        return superTypeNames;
+    }
+
+    @Override
+    public void setDeclaredSuperTypeNames(String[] names) {
+        this.superTypeNames = names;
+    }
+
+    @Override
+    public void addSupertype(String name) throws RepositoryException {
+        String[] names = new String[superTypeNames.length + 1];
+        System.arraycopy(superTypeNames, 0, names, 0, superTypeNames.length);
+        names[superTypeNames.length] = name;
+        superTypeNames = names;
+    }
+
+    @Override
+    public List<PropertyDefinitionTemplate> getPropertyDefinitionTemplates() {
+        return propertyDefinitionTemplates;
+    }
+
+    @Override
+    public List<NodeDefinitionTemplate> getNodeDefinitionTemplates() {
+        return nodeDefinitionTemplates;
+    }
+
+    @Override
+    public PropertyDefinition[] getDeclaredPropertyDefinitions() {
+        return propertyDefinitionTemplates.toArray(
+                new PropertyDefinition[propertyDefinitionTemplates.size()]);
+    }
+
+    @Override
+    public NodeDefinition[] getDeclaredChildNodeDefinitions() {
+        return nodeDefinitionTemplates.toArray(
+                new NodeDefinition[nodeDefinitionTemplates.size()]);
+    }
+
+}
\ No newline at end of file

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeTemplateImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/PropertyDefinitionTemplateImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/PropertyDefinitionTemplateImpl.java?rev=1363452&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/PropertyDefinitionTemplateImpl.java
(added)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/PropertyDefinitionTemplateImpl.java
Thu Jul 19 18:16:10 2012
@@ -0,0 +1,189 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.plugins.type;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.Value;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.NodeTypeTemplate;
+import javax.jcr.nodetype.PropertyDefinitionTemplate;
+
+import org.apache.jackrabbit.commons.cnd.DefinitionBuilderFactory.AbstractPropertyDefinitionBuilder;
+
+abstract class PropertyDefinitionTemplateImpl
+        extends AbstractPropertyDefinitionBuilder<NodeTypeTemplate>
+        implements PropertyDefinitionTemplate {
+
+    private String[] valueConstraints = null;
+
+    private Value[] defaultValues = null;
+
+    protected Value createValue(String value) throws RepositoryException {
+        throw new UnsupportedRepositoryOperationException();
+    }
+
+    @Override
+    public void build() {
+        // do nothing by default
+    }
+
+    @Override
+    public NodeType getDeclaringNodeType() {
+        return null;
+    }
+
+    @Override
+    public void setDeclaringNodeType(String name) {
+        // ignore
+    }
+
+    @Override
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public boolean isAutoCreated() {
+        return autocreate;
+    }
+
+    @Override
+    public void setAutoCreated(boolean autocreate) {
+        this.autocreate = autocreate;
+    }
+
+    @Override
+    public boolean isProtected() {
+        return isProtected;
+    }
+
+    @Override
+    public void setProtected(boolean isProtected) {
+        this.isProtected = isProtected;
+    }
+
+    @Override
+    public boolean isMandatory() {
+        return isMandatory;
+    }
+
+    @Override
+    public void setMandatory(boolean isMandatory) {
+        this.isMandatory = isMandatory;
+    }
+
+    @Override
+    public int getOnParentVersion() {
+        return onParent;
+    }
+
+    @Override
+    public void setOnParentVersion(int onParent) {
+        this.onParent = onParent;
+    }
+
+    @Override
+    public void setRequiredType(int requiredType) {
+        this.requiredType = requiredType;
+    }
+
+    @Override
+    public boolean isMultiple() {
+        return isMultiple;
+    }
+
+    @Override
+    public void setMultiple(boolean isMultiple) {
+        this.isMultiple = isMultiple;
+    }
+
+    @Override
+    public boolean isQueryOrderable() {
+        return queryOrderable;
+    }
+
+    @Override
+    public void setQueryOrderable(boolean queryOrderable) {
+        this.queryOrderable = queryOrderable;
+    }
+
+    @Override
+    public boolean isFullTextSearchable() {
+        return fullTextSearchable;
+    }
+
+    @Override
+    public void setFullTextSearchable(boolean fullTextSearchable) {
+        this.fullTextSearchable = fullTextSearchable;
+    }
+
+    @Override
+    public String[] getAvailableQueryOperators() {
+        return queryOperators;
+    }
+
+    @Override
+    public void setAvailableQueryOperators(String[] queryOperators) {
+        this.queryOperators = queryOperators;
+    }
+
+    @Override
+    public Value[] getDefaultValues() {
+        return defaultValues;
+    }
+
+    @Override
+    public void setDefaultValues(Value[] defaultValues) {
+        this.defaultValues = defaultValues;
+    }
+
+    @Override
+    public void addDefaultValues(String value) throws RepositoryException {
+        if (defaultValues == null) {
+            defaultValues = new Value[] { createValue(value) };
+        } else {
+            Value[] values = new Value[defaultValues.length + 1];
+            System.arraycopy(defaultValues, 0, values, 0, defaultValues.length);
+            values[defaultValues.length] = createValue(value);
+            defaultValues = values;
+        }
+    }
+
+    @Override
+    public String[] getValueConstraints() {
+        return valueConstraints;
+    }
+
+    @Override
+    public void setValueConstraints(String[] constraints) {
+        this.valueConstraints = constraints;
+    }
+
+    @Override
+    public void addValueConstraint(String constraint) {
+        if (valueConstraints == null) {
+            valueConstraints = new String[] { constraint };
+        } else {
+            String[] constraints = new String[valueConstraints.length + 1];
+            System.arraycopy(valueConstraints, 0, constraints, 0, valueConstraints.length);
+            constraints[valueConstraints.length] = constraint;
+            valueConstraints = constraints;
+        }
+    }
+
+}
\ No newline at end of file

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/PropertyDefinitionTemplateImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message