Class XmlAttribute
java.lang.Object
com.northconcepts.datapipeline.xml.builder.XmlAttribute
An attribute of an
XmlElement whose name and value are expressions, optionally written only when a
condition is true.-
Constructor Summary
ConstructorsConstructorDescriptionXmlAttribute(String name, String value) Creates an attribute whose name and value are expressions; quote literal text, as in'id'.XmlAttribute(String name, String value, String condition) Creates an attribute that is written only when the logical expressionconditionis true. -
Method Summary
Modifier and TypeMethodDescriptionReturns the condition that must be true for the attribute to be written, or null if it is always written.getName()getValue()voidwrite(ExpressionContext context, CodeWriter writer) Writes the attribute asname="value", both XML-escaped, unless its condition is false.
-
Constructor Details
-
XmlAttribute
Creates an attribute whose name and value are expressions; quote literal text, as in'id'. -
XmlAttribute
Creates an attribute that is written only when the logical expressionconditionis true.
-
-
Method Details
-
getName
-
getValue
-
getCondition
Returns the condition that must be true for the attribute to be written, or null if it is always written. -
write
Writes the attribute asname="value", both XML-escaped, unless its condition is false.- Throws:
IOException
-