Package com.theoryinpractise.halbuilder.impl.representations

Examples of com.theoryinpractise.halbuilder.impl.representations.MutableRepresentation


        return newRepresentation((String) null);
    }

    @Override
    public Representation newRepresentation(String href) {
        MutableRepresentation representation = new MutableRepresentation(this, href);

        // Add factory standard namespaces
        for (Map.Entry<String, String> entry : namespaceManager.getNamespaces().entrySet()) {
            representation.withNamespace(entry.getKey(), entry.getValue());
        }

        // Add factory standard links
        for (Link link : links) {
            representation.withLink(link.getRel(), link.getHref(), link.getName(), link.getTitle(), link.getHreflang(), link.getProfile());
        }

        return representation;
    }
View Full Code Here


        try {
            ObjectMapper mapper = new ObjectMapper();

            JsonNode rootNode = mapper.readValue(reader, JsonNode.class);

            MutableRepresentation resource = readResource(rootNode);

            return resource.toImmutableResource();
        } catch (Exception e) {
            throw new RepresentationException(e);
        }

    }
View Full Code Here

        }

    }

    private MutableRepresentation readResource(JsonNode rootNode) {
        MutableRepresentation resource = new MutableRepresentation(representationFactory);

        readNamespaces(resource, rootNode);
        readLinks(resource, rootNode);
        readProperties(resource, rootNode);
        readResources(resource, rootNode);
View Full Code Here

        }
    }

    private MutableRepresentation readRepresentation(Element root) {
        String href = root.getAttributeValue("href");
        MutableRepresentation resource = new MutableRepresentation(representationFactory, href);

        readNamespaces(resource, root);
        readLinks(resource, root);
        readProperties(resource, root);
        readResources(resource, root);
View Full Code Here

        return newRepresentation((String) null);
    }

    @Override
    public Representation newRepresentation(String href) {
        MutableRepresentation representation = new MutableRepresentation(this, href);

        // Add factory standard namespaces
        for (Map.Entry<String, String> entry : namespaceManager.getNamespaces().entrySet()) {
            representation.withNamespace(entry.getKey(), entry.getValue());
        }

        // Add factory standard links
        for (Link link : links) {
            representation.withLink(link.getRel(), link.getHref(), link.getName(), link.getTitle(), link.getHreflang(), link.getProfile());
        }

        return representation;
    }
View Full Code Here

        }
    }

    private MutableRepresentation readRepresentation(Element root) {
        String href = root.getAttributeValue("href");
        MutableRepresentation resource = new MutableRepresentation(representationFactory, href);

        readNamespaces(resource, root);
        readLinks(resource, root);
        readProperties(resource, root);
        readResources(resource, root);
View Full Code Here

TOP

Related Classes of com.theoryinpractise.halbuilder.impl.representations.MutableRepresentation

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.