/** * @param in * @throws IOException * @throws InvalidNodeTypeDefException */ public void load(InputStream in) throws IOException, InvalidNodeTypeDefException, RepositoryException { QNodeTypeDefinition[] types = NodeTypeReader.read(in); for (QNodeTypeDefinition type : types) { add(type); } }
/** * @param nodeTypeName node type name * @return <code>true</code> if the specified node type is built-in; * <code>false</code> otherwise. */ public boolean isBuiltIn(Name nodeTypeName) { return builtInNTDefs.contains(nodeTypeName); }
if (in != null) { Reader r = new InputStreamReader(in, StandardCharsets.UTF_8); store.loadCND(r, BUILTIN_NODETYPES_RESOURCE_PATH);
builtInNTDefs = new NodeTypeDefStore(); try { internalRegister(builtInNTDefs.all(), false, true); } catch (InvalidNodeTypeDefException intde) { String error = customNTDefs = new NodeTypeDefStore(); internalRegister(customNTDefs.all(), false); } catch (InvalidNodeTypeDefException intde) { String error =
OutputStream out = customNodeTypesResource.getOutputStream(); try { store.store(out, nsReg); } finally { out.close();
} else { try { store.load(in); } catch (IOException ioe) { String error =
builtInNTDefs = new NodeTypeDefStore(); try { internalRegister(builtInNTDefs.all(), false, true); } catch (InvalidNodeTypeDefException intde) { String error = customNTDefs = new NodeTypeDefStore(); internalRegister(customNTDefs.all(), false); } catch (InvalidNodeTypeDefException intde) { String error =
OutputStream out = customNodeTypesResource.getOutputStream(); try { store.store(out, nsReg); } finally { out.close();
} else { try { store.load(in); } catch (IOException ioe) { String error =
/** * @param in * @throws IOException * @throws InvalidNodeTypeDefException */ public void load(InputStream in) throws IOException, InvalidNodeTypeDefException, RepositoryException { QNodeTypeDefinition[] types = NodeTypeReader.read(in); for (QNodeTypeDefinition type : types) { add(type); } }
/** * @param nodeTypeName node type name * @return <code>true</code> if the specified node type is built-in; * <code>false</code> otherwise. */ public boolean isBuiltIn(Name nodeTypeName) { return builtInNTDefs.contains(nodeTypeName); }
if (in != null) { Reader r = new InputStreamReader(in, StandardCharsets.UTF_8); store.loadCND(r, BUILTIN_NODETYPES_RESOURCE_PATH);
customNTDefs.add(ntd); persistCustomNodeTypeDefs(customNTDefs);
customNTDefs.add(ntd); persistCustomNodeTypeDefs(customNTDefs);
/** * Loads node types from a CND stream. * * @param in reader containing the nodetype definitions * @param systemId optional name of the stream * * @throws IOException if an I/O error during reading occurs * @throws InvalidNodeTypeDefException if the CND cannot be parsed */ public void loadCND(Reader in, String systemId) throws IOException, InvalidNodeTypeDefException { try { CompactNodeTypeDefReader<QNodeTypeDefinition, NamespaceMapping> r = new CompactNodeTypeDefReader<QNodeTypeDefinition, NamespaceMapping>( in, systemId, new QDefinitionBuilderFactory()); for (QNodeTypeDefinition qdef: r.getNodeTypeDefinitions()) { add(qdef); } } catch (ParseException e) { throw new InvalidNodeTypeDefException("Unable to parse CND stream.", e); } }