congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
TypeEditor.primaryChanged
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: apache/jackrabbit-oak

@Override
public TypeEditor childNodeChanged(
    String name, NodeState before, NodeState after)
    throws CommitFailedException {
  String primary = after.getName(JCR_PRIMARYTYPE);
  Iterable<String> mixins = after.getNames(JCR_MIXINTYPES);
  if (primary == null && effective != null) {
    // no primary type defined, find and apply a default type
    primary = effective.getDefaultType(name);
    if (primary != null) {
      builder.setProperty(JCR_PRIMARYTYPE, primary, NAME);
    } else {
      constraintViolation(
          4, "No default primary type available "
          + " for child node " + name);
    }
  }
  // if node type didn't change no need to validate child node
  boolean validate = primaryChanged(before, primary) || mixinsChanged(before, mixins);
  NodeBuilder childBuilder = builder.getChildNode(name);
  TypeEditor editor = new TypeEditor(this, name, primary, mixins, childBuilder, validate);
  if (checkThisNode && validate && !effective.isValidChildNode(name, editor.getEffective())) {
    constraintViolation(
        1, "No matching definition found for child node " + name
        + " with effective type " + editor.getEffective());
  }
  return editor;
}
origin: org.apache.jackrabbit/oak-core

@Override
public TypeEditor childNodeChanged(
    String name, NodeState before, NodeState after)
    throws CommitFailedException {
  String primary = after.getName(JCR_PRIMARYTYPE);
  Iterable<String> mixins = after.getNames(JCR_MIXINTYPES);
  if (primary == null && effective != null) {
    // no primary type defined, find and apply a default type
    primary = effective.getDefaultType(name);
    if (primary != null) {
      builder.setProperty(JCR_PRIMARYTYPE, primary, NAME);
    } else {
      constraintViolation(
          4, "No default primary type available "
          + " for child node " + name);
    }
  }
  // if node type didn't change no need to validate child node
  boolean validate = primaryChanged(before, primary) || mixinsChanged(before, mixins);
  NodeBuilder childBuilder = builder.getChildNode(name);
  TypeEditor editor = new TypeEditor(this, name, primary, mixins, childBuilder, validate);
  if (checkThisNode && validate && !effective.isValidChildNode(name, editor.getEffective())) {
    constraintViolation(
        1, "No matching definition found for child node " + name
        + " with effective type " + editor.getEffective());
  }
  return editor;
}
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public TypeEditor childNodeChanged(
    String name, NodeState before, NodeState after)
    throws CommitFailedException {
  String primary = after.getName(JCR_PRIMARYTYPE);
  Iterable<String> mixins = after.getNames(JCR_MIXINTYPES);
  if (primary == null && effective != null) {
    // no primary type defined, find and apply a default type
    primary = effective.getDefaultType(name);
    if (primary != null) {
      builder.setProperty(JCR_PRIMARYTYPE, primary, NAME);
    } else {
      constraintViolation(
          4, "No default primary type available "
          + " for child node " + name);
    }
  }
  // if node type didn't change no need to validate child node
  boolean validate = primaryChanged(before, primary) || mixinsChanged(before, mixins);
  NodeBuilder childBuilder = builder.getChildNode(name);
  TypeEditor editor = new TypeEditor(this, name, primary, mixins, childBuilder, validate);
  if (checkThisNode && validate && !effective.isValidChildNode(name, editor.getEffective())) {
    constraintViolation(
        1, "No matching definition found for child node " + name
        + " with effective type " + editor.getEffective());
  }
  return editor;
}
org.apache.jackrabbit.oak.plugins.nodetypeTypeEditorprimaryChanged

Popular methods of TypeEditor

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

Popular in Java

  • Updating database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • setContentView (Activity)
  • getApplicationContext (Context)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Top 12 Jupyter Notebook extensions
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