Package org.xembly

Examples of org.xembly.Directives


        this.storage = stg;
        this.self = login;
        this.coords = rep;
        this.rel = number;
        this.storage.apply(
            new Directives().xpath(
                String.format(
                    // @checkstyle LineLengthCheck (1 line)
                    "/github/repos/repo[@coords='%s']/releases/release[id='%d']",
                    this.coords, this.rel
                )
View Full Code Here


        try {
            number = 1 + this.storage.xml().xpath(
                String.format("%s/asset/id/text()", this.xpath())
            ).size();
            this.storage.apply(
                new Directives().xpath(this.xpath()).add("asset")
                    .add("id").set(Integer.toString(number)).up()
                    .add("name").set(name).up()
                    .add("content").set(new String(content, "UTF-8")).up()
                    .add("content_type").set(type).up()
                    .add("size").set(Integer.toString(content.length)).up()
View Full Code Here

    ) throws IOException {
        this.storage = stg;
        this.self = login;
        this.coords = rep;
        this.storage.apply(
            new Directives().xpath(
                String.format(
                    "/github/repos/repo[@coords='%s']/git",
                    this.coords
                )
            ).addIf("trees")
View Full Code Here

    ) throws IOException {
        final JsonArray trees = params.getJsonArray("tree");
        for (final JsonValue val : trees) {
            final JsonObject tree = (JsonObject) val;
            final String sha = tree.getString("sha");
            final Directives dirs = new Directives().xpath(this.xpath())
                .add("tree");
            for (final Entry<String, JsonValue> entry : tree.entrySet()) {
                dirs.add(entry.getKey()).set(entry.getValue().toString()).up();
            }
            this.storage.apply(dirs);
            final String ref;
            if (tree.containsValue("name")) {
                ref = tree.getString("name");
View Full Code Here

    ) throws IOException {
        this.storage = stg;
        this.self = login;
        this.coords = repo;
        this.storage.apply(
            new Directives().xpath(
                String.format("/github/repos/repo[@coords='%s']", this.coords)
            ).addIf("commits")
        );
    }
View Full Code Here

    }

    @Override
    public void remove() throws IOException {
        this.storage.apply(
            new Directives().xpath(this.xpath()).strict(1).remove()
        );
    }
View Full Code Here

    public void readsAndWrites() throws Exception {
        final MkStorage storage = new MkStorage.InFile();
        storage.lock();
        try {
            storage.apply(
                new Directives().xpath("/github").add("test")
                    .set("hello, world")
            );
            MatcherAssert.assertThat(
                storage.xml().xpath("/github/test/text()").get(0),
                Matchers.endsWith(", world")
View Full Code Here

            }
        );
        try {
            latch.await();
            storage.apply(
                new Directives().xpath("/github").add("test")
                    .set("hello, world")
            );
        } finally {
            executor.shutdown();
        }
View Full Code Here

    }

    @Override
    public void delete() throws IOException {
        this.storage.apply(
            new Directives().xpath(this.xpath()).strict(1).remove()
        );
    }
View Full Code Here

        this.storage = stg;
        this.self = login;
        this.repo = rep;
        this.owner = pull;
        this.storage.apply(
            new Directives().xpath(
                String.format(
                    "/github/repos/repo[@coords='%s']/pulls/pull[number='%d']",
                    this.repo, this.owner.number()
                )
            ).addIf("comments")
View Full Code Here

TOP

Related Classes of org.xembly.Directives

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.