Example usage for org.dom4j.dtd AttributeDecl getValue

List of usage examples for org.dom4j.dtd AttributeDecl getValue

Introduction

In this page you can find the example usage for org.dom4j.dtd AttributeDecl getValue.

Prototype

public String getValue() 

Source Link

Document

Getter for property value.

Usage

From source file:com.cladonia.xml.XDocumentType.java

License:Open Source License

private void write(Writer writer, AttributeDecl decl) throws IOException {
    String elementName = decl.getElementName();
    String attributeName = decl.getAttributeName();
    String type = decl.getType();
    String valueDefault = decl.getValueDefault();
    String value = decl.getValue();

    StringBuffer buffer = new StringBuffer("<!ATTLIST ");
    buffer.append(elementName);//from  ww w.j  a va 2 s.  c  o m
    buffer.append(" ");
    buffer.append(attributeName);
    buffer.append(" ");
    buffer.append(type);
    buffer.append(" ");
    if (valueDefault != null) {
        buffer.append(valueDefault);
        if (valueDefault.equals("#FIXED")) {
            buffer.append(" \"");
            buffer.append(value);
            buffer.append("\"");
        }
    } else {
        buffer.append("\"");
        buffer.append(value);
        buffer.append("\"");
    }
    buffer.append(">");

    writer.write(buffer.toString());
}