Java Code Examples for org.xembly.Directives#append()

The following examples show how to use org.xembly.Directives#append() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XmlMethodDef.java    From eo with MIT License 6 votes vote down vote up
@Override
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
public Iterator<Directive> iterator() {
    final Directives dir = new Directives()
        .add("method")
        .attr("name", this.name)
        .add("type")
        .attr("name", this.type)
        .up();
    dir.add("params");
    for (final Parameter param : this.params) {
        dir.append(param.xml());
    }
    dir.up();
    return dir.up().iterator();
}
 
Example 2
Source File: XmlTypeDef.java    From eo with MIT License 6 votes vote down vote up
@Override
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
public Iterator<Directive> iterator() {
    final Directives dir = new Directives().add("type")
        .attr("name", this.name);
    dir.add("super");
    for (final String type : this.spr) {
        dir.add("type").attr("name", type).up();
    }
    dir.up();
    dir.add("methods");
    for (final Method method : this.methods) {
        dir.append(method.xml());
    }
    dir.up();
    return dir.up().iterator();
}
 
Example 3
Source File: ObjectBody.java    From eo with MIT License 5 votes vote down vote up
/**
 * As XML.
 * @return Directives
 */
public Iterable<Directive> xml() {
    final Directives dir = new Directives();
    dir.add("attributes");
    for (final Attribute attr : this.attrs) {
        dir.append(attr.xml());
    }
    return dir;
}
 
Example 4
Source File: Object.java    From eo with MIT License 5 votes vote down vote up
@Override
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
public Iterable<Directive> xml() {
    final Directives dir = new Directives()
        .add("object")
        .attr("name", this.name);
    dir.add("types");
    for (final String type : this.types) {
        dir.add("type").attr("name", type).up();
    }
    dir.up();
    dir.append(this.body.xml());
    return dir.up();
}
 
Example 5
Source File: XmlModule.java    From eo with MIT License 5 votes vote down vote up
@Override
public Iterator<Directive> iterator() {
    final Directives dir = new Directives().add("module");
    for (final RootNode node : this.nodes) {
        dir.append(node.xml());
    }
    return dir.up().iterator();
}