@Test public void shouldNotBeDerivedFromIfNoMatch() throws Exception { assertFalse(this.nodeTypeMgr.isDerivedFrom(SUBTYPES, NO_MATCH_TYPE, MIXINS)); }
public boolean isDerivedFrom( String[] testTypeNames, String primaryTypeName, String[] mixinNames ) throws RepositoryException { CheckArg.isNotEmpty(testTypeNames, "testTypeNames"); CheckArg.isNotEmpty(primaryTypeName, "primaryTypeName"); NameFactory nameFactory = context().getValueFactories().getNameFactory(); Name[] typeNames = nameFactory.create(testTypeNames); for (Name typeName : typeNames) { JcrNodeType nodeType = getNodeType(typeName); if ((nodeType != null) && nodeType.isNodeType(primaryTypeName)) { return true; } } if (mixinNames != null) { for (String mixin : mixinNames) { for (Name typeName : typeNames) { JcrNodeType nodeType = getNodeType(typeName); if ((nodeType != null) && nodeType.isNodeType(mixin)) { return true; } } } } return false; }
JcrNodeTypeManager implements NodeTypeManager { public boolean isDerivedFrom( String[] testTypeNames, String primaryTypeName, String[] mixinNames ) throws RepositoryException { CheckArg.isNotEmpty(testTypeNames, "testTypeNames"); CheckArg.isNotEmpty(primaryTypeName, "primaryTypeName"); NameFactory nameFactory = context().getValueFactories().getNameFactory(); Name[] typeNames = nameFactory.create(testTypeNames); for (Name typeName : typeNames) { JcrNodeType nodeType = getNodeType(typeName); if ((nodeType != null) && nodeType.isNodeType(primaryTypeName)) { return true; } } if (mixinNames != null) { for (String mixin : mixinNames) { for (Name typeName : typeNames) { JcrNodeType nodeType = getNodeType(typeName); if ((nodeType != null) && nodeType.isNodeType(mixin)) { return true; } } } } return false; } }
JcrNodeTypeManager implements NodeTypeManager { public boolean isDerivedFrom( String[] testTypeNames, String primaryTypeName, String[] mixinNames ) throws RepositoryException { CheckArg.isNotEmpty(testTypeNames, "testTypeNames"); CheckArg.isNotEmpty(primaryTypeName, "primaryTypeName"); NameFactory nameFactory = context().getValueFactories().getNameFactory(); Name[] typeNames = nameFactory.create(testTypeNames); for (Name typeName : typeNames) { JcrNodeType nodeType = getNodeType(typeName); if ((nodeType != null) && nodeType.isNodeType(primaryTypeName)) { return true; } } if (mixinNames != null) { for (String mixin : mixinNames) { for (Name typeName : typeNames) { JcrNodeType nodeType = getNodeType(typeName); if ((nodeType != null) && nodeType.isNodeType(mixin)) { return true; } } } } return false; } JcrNodeTypeManager( JcrSession session,
                        RepositoryNodeTypeManager repositoryTypeManager ); }
JcrNodeTypeManager implements NodeTypeManager { public boolean isDerivedFrom( String[] testTypeNames, String primaryTypeName, String[] mixinNames ) throws RepositoryException { CheckArg.isNotEmpty(testTypeNames, "testTypeNames"); CheckArg.isNotEmpty(primaryTypeName, "primaryTypeName"); NameFactory nameFactory = context().getValueFactories().getNameFactory(); Name[] typeNames = nameFactory.create(testTypeNames); for (Name typeName : typeNames) { JcrNodeType nodeType = getNodeType(typeName); if ((nodeType != null) && nodeType.isNodeType(primaryTypeName)) { return true; } } if (mixinNames != null) { for (String mixin : mixinNames) { for (Name typeName : typeNames) { JcrNodeType nodeType = getNodeType(typeName); if ((nodeType != null) && nodeType.isNodeType(mixin)) { return true; } } } } return false; } JcrNodeTypeManager( JcrSession session,
                        RepositoryNodeTypeManager repositoryTypeManager ); @Override NodeTypeIterator getAllNodeTypes(); @Override NodeTypeIterator getMixinNodeTypes(); @Override JcrNodeType getNodeType( String nodeTypeName ); @Override boolean hasNodeType( String nodeTypeName ); @Override NodeTypeIterator getPrimaryNodeTypes(); @Override NodeType registerNodeType( NodeTypeDefinition template,
                                      boolean allowUpdate ); NodeTypeIterator registerNodeTypes( Collection<NodeTypeDefinition> templates,
                                               boolean allowUpdates ); NodeTypeIterator registerNodeTypes( Iterable<NodeTypeDefinition> nodeTypes ); @Override NodeTypeIterator registerNodeTypes( NodeTypeDefinition[] ntds,
                                               boolean allowUpdate ); @Override void unregisterNodeType( String nodeTypeName ); void unregisterNodeTypes( Collection<String> nodeTypeNames ); @Override void unregisterNodeTypes( String[] names ); @Override NodeTypeTemplate createNodeTypeTemplate(); @Override @SuppressWarnings( "unchecked" ) NodeTypeTemplate createNodeTypeTemplate( NodeTypeDefinition ntd ); @Override NodeDefinitionTemplate createNodeDefinitionTemplate(); @Override PropertyDefinitionTemplate createPropertyDefinitionTemplate(); boolean isDerivedFrom( String[] testTypeNames,
                                  String primaryTypeName,
                                  String[] mixinNames ); @Override NodeTypeIterator registerNodeTypes( File file,
                                               boolean allowUpdate ); @Override NodeTypeIterator registerNodeTypes( InputStream stream,
                                               boolean allowUpdate ); @Override NodeTypeIterator registerNodeTypes( URL url,
                                               boolean allowUpdate ); }
JcrNodeTypeManager implements NodeTypeManager { public boolean isDerivedFrom( String[] testTypeNames, String primaryTypeName, String[] mixinNames ) throws RepositoryException { CheckArg.isNotEmpty(testTypeNames, "testTypeNames"); CheckArg.isNotEmpty(primaryTypeName, "primaryTypeName"); NameFactory nameFactory = context().getValueFactories().getNameFactory(); Name[] typeNames = nameFactory.create(testTypeNames); for (Name typeName : typeNames) { JcrNodeType nodeType = getNodeType(typeName); if ((nodeType != null) && nodeType.isNodeType(primaryTypeName)) { return true; } } if (mixinNames != null) { for (String mixin : mixinNames) { for (Name typeName : typeNames) { JcrNodeType nodeType = getNodeType(typeName); if ((nodeType != null) && nodeType.isNodeType(mixin)) { return true; } } } } return false; } JcrNodeTypeManager( JcrSession session,
                        RepositoryNodeTypeManager repositoryTypeManager ); @Override NodeTypeIterator getAllNodeTypes(); @Override NodeTypeIterator getMixinNodeTypes(); @Override JcrNodeType getNodeType( String nodeTypeName ); @Override boolean hasNodeType( String nodeTypeName ); @Override NodeTypeIterator getPrimaryNodeTypes(); @Override NodeType registerNodeType( NodeTypeDefinition template,
                                      boolean allowUpdate ); NodeTypeIterator registerNodeTypes( Collection<NodeTypeDefinition> templates,
                                               boolean allowUpdates ); NodeTypeIterator registerNodeTypes( Iterable<NodeTypeDefinition> nodeTypes ); @Override NodeTypeIterator registerNodeTypes( NodeTypeDefinition[] ntds,
                                               boolean allowUpdate ); @Override void unregisterNodeType( String nodeTypeName ); void unregisterNodeTypes( Collection<String> nodeTypeNames ); @Override void unregisterNodeTypes( String[] names ); @Override NodeTypeTemplate createNodeTypeTemplate(); @Override @SuppressWarnings( "unchecked" ) NodeTypeTemplate createNodeTypeTemplate( NodeTypeDefinition ntd ); @Override NodeDefinitionTemplate createNodeDefinitionTemplate(); @Override PropertyDefinitionTemplate createPropertyDefinitionTemplate(); boolean isDerivedFrom( String[] testTypeNames,
                                  String primaryTypeName,
                                  String[] mixinNames ); @Override NodeTypeIterator registerNodeTypes( File file,
                                               boolean allowUpdate ); @Override NodeTypeIterator registerNodeTypes( InputStream stream,
                                               boolean allowUpdate ); @Override NodeTypeIterator registerNodeTypes( URL url,
                                               boolean allowUpdate );  }