/** * Helper to create Qualified name from current xml element * * @param xpp XmlPullParser * @return QName */ private QName getName(XmlPullParser xpp) { // Ensure namespace is valid String uri = xpp.getNamespace(); if (namespaceService.getURIs().contains(uri) == false) { throw new ImporterException("Namespace URI " + uri + " has not been defined in the Repository dictionary"); } // Construct name String name = xpp.getName(); return QName.createQName(uri, name); }
/** * Helper to create Qualified name from current xml element * * @param xpp XmlPullParser * @return QName */ private QName getName(XmlPullParser xpp) { // Ensure namespace is valid String uri = xpp.getNamespace(); if (namespaceService.getURIs().contains(uri) == false) { throw new ImporterException("Namespace URI " + uri + " has not been defined in the Repository dictionary"); } // Construct name String name = xpp.getName(); return QName.createQName(uri, name); }
/** * {@inheritDoc} */ public void addProperty(RegistryKey key, Serializable value) { if (key.getProperty() == null) { throw new IllegalArgumentException("Registry values must be added using paths that contain property names: " + key); } // Check the namespace being used in the key String namespaceUri = key.getNamespaceUri(); if (!namespaceService.getURIs().contains(namespaceUri)) { throw new NamespaceException("Unable to add a registry value with an unregistered namespace: " + namespaceUri); } // Get the path, with creation support Pair<NodeRef, QName> keyPair = getPath(key, true); // We know that the node exists, so just set the value nodeService.setProperty(keyPair.getFirst(), keyPair.getSecond(), value); // Done if (logger.isDebugEnabled()) { logger.debug("Added value to registry: \n" + " Key: " + key + "\n" + " Value: " + value); } }
/** * {@inheritDoc} */ public void addProperty(RegistryKey key, Serializable value) { if (key.getProperty() == null) { throw new IllegalArgumentException("Registry values must be added using paths that contain property names: " + key); } // Check the namespace being used in the key String namespaceUri = key.getNamespaceUri(); if (!namespaceService.getURIs().contains(namespaceUri)) { throw new NamespaceException("Unable to add a registry value with an unregistered namespace: " + namespaceUri); } // Get the path, with creation support Pair<NodeRef, QName> keyPair = getPath(key, true); // We know that the node exists, so just set the value nodeService.setProperty(keyPair.getFirst(), keyPair.getSecond(), value); // Done if (logger.isDebugEnabled()) { logger.debug("Added value to registry: \n" + " Key: " + key + "\n" + " Value: " + value); } }