Package org.jboss.dna.graph.property

Examples of org.jboss.dna.graph.property.Property


        JcrPropertyDefinition definition = nodeTypes().findPropertyDefinition(nodePayload.getPrimaryTypeName(),
                                                                              nodePayload.getMixinTypeNames(),
                                                                              DnaIntLexicon.MULTI_VALUED_PROPERTIES,
                                                                              values,
                                                                              false);
        Property dnaProp = propertyFactory.create(DnaIntLexicon.MULTI_VALUED_PROPERTIES, singleMultiPropertyNames.iterator());
        return createPropertyInfo(nodePayload, dnaProp, definition, PropertyType.STRING, existing);
    }
View Full Code Here


    private final List<Property> properties;

    LocationWithUuid( UUID uuid ) {
        assert uuid != null;
        this.uuid = uuid;
        Property uuidProperty = new BasicSingleValueProperty(DnaLexicon.UUID, uuid);
        this.properties = Collections.singletonList(uuidProperty);
        this.hashCode = HashCode.compute(null, this.properties);
    }
View Full Code Here

            if (projectedNode.isPlaceholder()) {
                PlaceholderNode placeholder = projectedNode.asPlaceholder();
                // Create a request and set the results ...
                ReadPropertyRequest placeholderRequest = new ReadPropertyRequest(placeholder.location(), request.inWorkspace(),
                                                                                 request.named());
                Property property = placeholder.properties().get(request.named());
                placeholderRequest.setProperty(property);
                placeholderRequest.setActualLocationOfNode(placeholder.location());
                federatedRequest.add(placeholderRequest, true, true, null);
            } else if (projectedNode.isProxy()) {
                ProxyNode proxy = projectedNode.asProxy();
View Full Code Here

     * @see Location#getIdProperty(Name)
     */
    @Override
    public final Property getIdProperty( Name name ) {
        CheckArg.isNotNull(name, "name");
        Property property = idProperties.get(0); // this is fast
        return property.getName().equals(name) ? property : null;
    }
View Full Code Here

     *
     * @see Location#getUuid()
     */
    @Override
    public UUID getUuid() {
        Property property = idProperties.get(0); // this is fast
        if (DnaLexicon.UUID.equals(property.getName())) {
            Object value = property.getFirstValue();
            if (value instanceof UUID) return (UUID)value;
            if (value instanceof String) return UUID.fromString((String)value);
        }
        return null;
    }
View Full Code Here

     * @see Location#with(Property)
     */
    @Override
    public Location with( Property newIdProperty ) {
        if (newIdProperty == null || newIdProperty.isEmpty()) return this;
        Property idProperty = idProperties.get(0); // fast
        if (newIdProperty.getName().equals(idProperty.getName())) {
            return new LocationWithPathAndProperty(path, newIdProperty);
        }
        return Location.create(path, idProperty, newIdProperty);
    }
View Full Code Here

     */
    @Override
    public Location with( Path newPath ) {
        if (newPath == null) return Location.create(idProperties);
        if (path.equals(newPath)) return this;
        Property idProperty = idProperties.get(0); // fast
        return new LocationWithPathAndProperty(newPath, idProperty);
    }
View Full Code Here

     *
     * @see Location#with(UUID)
     */
    @Override
    public Location with( UUID uuid ) {
        Property idProperty = idProperties.get(0); // fast
        if (uuid == null) return Location.create(path);
        assert !DnaLexicon.UUID.equals(idProperty.getName());
        Property newUuidProperty = new BasicSingleValueProperty(DnaLexicon.UUID, uuid);
        return Location.create(path, idProperty, newUuidProperty);
    }
View Full Code Here

     * Get the first UUID that is in one of the {@link #getIdProperties() identification properties}.
     *
     * @return the UUID for this location, or null if there is no such identification property
     */
    public UUID getUuid() {
        Property property = getIdProperty(DnaLexicon.UUID);
        if (property != null && !property.isEmpty()) {
            Object value = property.getFirstValue();
            if (value instanceof UUID) return (UUID)value;
        }
        return null;
    }
View Full Code Here

     * @see Location#with(UUID)
     */
    @Override
    public Location with( UUID uuid ) {
        if (uuid == null) return this;
        Property newProperty = new BasicSingleValueProperty(DnaLexicon.UUID, uuid);
        if (this.hasIdProperties()) {
            Property existing = this.getIdProperty(DnaLexicon.UUID);
            if (existing != null && existing.equals(newProperty)) return this;
        }

        List<Property> newIdProperties = new ArrayList<Property>(idProperties.size() + 1);
        newIdProperties.addAll(idProperties);
        newIdProperties.add(newProperty);
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.property.Property

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.