Tabnine Logo
TypeEditor.checkPropertyTypeConstraints
Code IndexAdd Tabnine to your IDE (free)

How to use
checkPropertyTypeConstraints
method
in
org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor

Best Java code snippets using org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.checkPropertyTypeConstraints (Showing top 6 results out of 315)

origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public void propertyChanged(PropertyState before, PropertyState after)
    throws CommitFailedException {
  if (checkThisNode) {
    checkPropertyTypeConstraints(after);
  }
}
origin: apache/jackrabbit-oak

@Override
public void propertyChanged(PropertyState before, PropertyState after)
    throws CommitFailedException {
  if (checkThisNode) {
    checkPropertyTypeConstraints(after);
  }
}
origin: org.apache.jackrabbit/oak-core

@Override
public void propertyChanged(PropertyState before, PropertyState after)
    throws CommitFailedException {
  if (checkThisNode) {
    checkPropertyTypeConstraints(after);
  }
}
origin: apache/jackrabbit-oak

private void checkNodeTypeConstraints(NodeState after) throws CommitFailedException {
  EffectiveType effective = getEffective();
  Set<String> properties = effective.getMandatoryProperties();
  for (PropertyState ps : after.getProperties()) {
    properties.remove(ps.getName());
    checkPropertyTypeConstraints(ps);
  }
  // verify the presence of all mandatory items
  if (!properties.isEmpty()) {
    constraintViolation(21, "Mandatory property " + properties.iterator().next() + " not found in a new node");
  }
  List<String> names = Lists.newArrayList(after.getChildNodeNames());
  for (String child : effective.getMandatoryChildNodes()) {
    if (!names.remove(child)) {
      constraintViolation(25, "Mandatory child node " + child + " not found in a new node");
    }
  }
  if (!names.isEmpty()) {
    for (String name : names) {
      NodeState child = after.getChildNode(name);
      String primary = child.getName(JCR_PRIMARYTYPE);
      Iterable<String> mixins = child.getNames(JCR_MIXINTYPES);
      NodeBuilder childBuilder = builder.getChildNode(name);
      TypeEditor editor = new TypeEditor(this, name, primary, mixins, childBuilder, false);
      if (!effective.isValidChildNode(name, editor.getEffective())) {
        constraintViolation(25, "Unexpected child node " + name + " found in a new node");
      }
    }
  }
}
origin: org.apache.jackrabbit/oak-core

private void checkNodeTypeConstraints(NodeState after) throws CommitFailedException {
  EffectiveType effective = getEffective();
  Set<String> properties = effective.getMandatoryProperties();
  for (PropertyState ps : after.getProperties()) {
    properties.remove(ps.getName());
    checkPropertyTypeConstraints(ps);
  }
  // verify the presence of all mandatory items
  if (!properties.isEmpty()) {
    constraintViolation(21, "Mandatory property " + properties.iterator().next() + " not found in a new node");
  }
  List<String> names = Lists.newArrayList(after.getChildNodeNames());
  for (String child : effective.getMandatoryChildNodes()) {
    if (!names.remove(child)) {
      constraintViolation(25, "Mandatory child node " + child + " not found in a new node");
    }
  }
  if (!names.isEmpty()) {
    for (String name : names) {
      NodeState child = after.getChildNode(name);
      String primary = child.getName(JCR_PRIMARYTYPE);
      Iterable<String> mixins = child.getNames(JCR_MIXINTYPES);
      NodeBuilder childBuilder = builder.getChildNode(name);
      TypeEditor editor = new TypeEditor(this, name, primary, mixins, childBuilder, false);
      if (!effective.isValidChildNode(name, editor.getEffective())) {
        constraintViolation(25, "Unexpected child node " + name + " found in a new node");
      }
    }
  }
}
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

private void checkNodeTypeConstraints(NodeState after) throws CommitFailedException {
  EffectiveType effective = getEffective();
  Set<String> properties = effective.getMandatoryProperties();
  for (PropertyState ps : after.getProperties()) {
    properties.remove(ps.getName());
    checkPropertyTypeConstraints(ps);
  }
  // verify the presence of all mandatory items
  if (!properties.isEmpty()) {
    constraintViolation(21, "Mandatory property " + properties.iterator().next() + " not found in a new node");
  }
  List<String> names = Lists.newArrayList(after.getChildNodeNames());
  for (String child : effective.getMandatoryChildNodes()) {
    if (!names.remove(child)) {
      constraintViolation(25, "Mandatory child node " + child + " not found in a new node");
    }
  }
  if (!names.isEmpty()) {
    for (String name : names) {
      NodeState child = after.getChildNode(name);
      String primary = child.getName(JCR_PRIMARYTYPE);
      Iterable<String> mixins = child.getNames(JCR_MIXINTYPES);
      NodeBuilder childBuilder = builder.getChildNode(name);
      TypeEditor editor = new TypeEditor(this, name, primary, mixins, childBuilder, false);
      if (!effective.isValidChildNode(name, editor.getEffective())) {
        constraintViolation(25, "Unexpected child node " + name + " found in a new node");
      }
    }
  }
}
org.apache.jackrabbit.oak.plugins.nodetypeTypeEditorcheckPropertyTypeConstraints

Popular methods of TypeEditor

  • <init>
  • checkNodeTypeConstraints
  • checkRequiredType
  • checkValueConstraints
  • childNodeChanged
  • constraintViolation
    Throws or logs the specified constraint violation.
  • createEffectiveType
  • getEffective
  • getPath
  • getRequiredType
  • mixinsChanged
  • primaryChanged
  • mixinsChanged,
  • primaryChanged,
  • propertyChanged,
  • childNodeDeleted,
  • create,
  • propertyDeleted

Popular in Java

  • Running tasks concurrently on multiple threads
  • getContentResolver (Context)
  • getResourceAsStream (ClassLoader)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • ImageIO (javax.imageio)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • CodeWhisperer alternatives
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