public void createProperty()

in src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java [319:363]


    public void createProperty(String name, int propertyType, String value) throws RepositoryException {
        appliedSet.add(name);
        final Node node = this.parentNodeStack.peek();
        // check if the property already exists and isPropertyOverwrite() is false,
        // don't overwrite it in this case
        if (node.hasProperty(name) && !this.configuration.isPropertyOverwrite() && !node.getProperty(name).isNew()) {
            return;
        }

        if (propertyType == PropertyType.REFERENCE) {
            // need to resolve the reference
            String propPath = node.getPath() + "/" + name; // NOSONAR
            String uuid = getUUID(node.getSession(), propPath, getAbsPath(node, value));
            if (uuid != null) {
                checkoutIfNecessary(node);
                node.setProperty(name, uuid, propertyType);
                if (this.importListener != null) {
                    this.importListener.onCreate(node.getProperty(name).getPath());
                }
            }
        } else if ("jcr:isCheckedOut".equals(name)) {
            // don't try to write the property but record its state
            // for later checkin if set to false
            final boolean checkedout = Boolean.parseBoolean(value);
            if (!checkedout && !this.versionables.contains(node)) {
                this.versionables.add(node);
            }
        } else if (propertyType == PropertyType.DATE) {
            checkoutIfNecessary(node);
            node.setProperty(name, ISO8601.parse(value));
            if (this.importListener != null) {
                this.importListener.onCreate(node.getProperty(name).getPath());
            }
        } else {
            checkoutIfNecessary(node);
            if (propertyType == PropertyType.UNDEFINED) {
                node.setProperty(name, value);
            } else {
                node.setProperty(name, value, propertyType);
            }
            if (this.importListener != null) {
                this.importListener.onCreate(node.getProperty(name).getPath());
            }
        }
    }