Package org.xembly

Examples of org.xembly.Directives


        try {
            number = 1 + this.storage.xml()
                .nodes(String.format("%s/comment/id/text()", this.xpath()))
                .size();
            this.storage.apply(
                new Directives().xpath(this.xpath()).add("comment")
                    .add("id").set(Integer.toString(number)).up()
                    .add("url").set("http://localhost/1").up()
                    .add("diff_hunk").set("@@ -16,33 +16,40 @@ public...").up()
                    // @checkstyle MultipleStringLiteralsCheck (4 lines)
                    .add("path").set(path).up()
View Full Code Here


    }

    @Override
    public void remove(final int number) throws IOException {
        this.storage.apply(
            new Directives().xpath(
                String.format("%s/comment[id='%d']", this.xpath(), number)
            ).remove()
        );
    }
View Full Code Here

        @NotNull(message = "login can't be NULL") final String login
    ) throws IOException {
        this.storage = stg;
        this.himself = login;
        this.storage.apply(
            new Directives().xpath("/github").addIf("users")
        );
    }
View Full Code Here

        @NotNull(message = "login can't be NULL") final String login
    ) throws IOException {
        this.storage = stg;
        this.self = login;
        this.storage.apply(
            new Directives().xpath(
                String.format("/github/users[not(user[login='%s'])]", login)
            ).add("user").add("login").set(login)
        );
    }
View Full Code Here

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

        @NotNull(message = "User is never null") final String user
    ) throws IOException {
        this.storage.lock();
        try {
            this.storage.apply(
                new Directives().xpath(this.xpath()).add("user").add("login")
                    .set(user)
            );
        } finally {
            this.storage.unlock();
        }
View Full Code Here

    @Override
    public void remove(
        @NotNull(message = "user should not be NULL") final String user
    ) throws IOException {
        this.storage.apply(
            new Directives().xpath(
                String.format("%s/user[login='%s']", this.xpath(), user)
            ).remove()
        );
    }
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("commits")
View Full Code Here

        while (listing.isTruncated()) {
            listing = client.listNextBatchOfObjects(listing);
            objects.addAll(listing.getObjectSummaries());
        }
        // @checkstyle LineLength (2 lines)
        final Directives dirs = new Directives()
            .add("directory").attr("prefix", key);
        for (final String prefix : listing.getCommonPrefixes()) {
            dirs.add("commonPrefix").set(prefix).up();
        }
        for (final S3ObjectSummary object : objects) {
            dirs.add("object")
                .add("path")
                .set(object.getKey()).up()
                .add("size")
                .set(Long.toString(object.getSize())).up()
                .up();
View Full Code Here

        while (listing.isTruncated()) {
            listing = client.listNextBatchOfVersions(listing);
            versions.addAll(listing.getVersionSummaries());
        }
        // @checkstyle LineLength (2 lines)
        final Directives dirs = new Directives()
            .add("versions").attr("object", key);
        for (final S3VersionSummary version : versions.build()) {
            dirs.add("version")
                .attr("key", version.getKey())
                .set(version.getVersionId()).up();
        }
        try {
            this.content = ObjectVersionListing.STYLESHEET.transform(
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.