本文整理汇总了Java中org.simpleframework.xml.stream.OutputNode.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java OutputNode.setValue方法的具体用法?Java OutputNode.setValue怎么用?Java OutputNode.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.simpleframework.xml.stream.OutputNode
的用法示例。
在下文中一共展示了OutputNode.setValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
public void write(OutputNode node) throws Exception {
OutputNode member = node.getChild(CODE);
OutputNode nameNode = member.getChild(Member.NAME);
nameNode.setValue(name);
OutputNode valueNode = member.getChild(Value.CODE);
value.write(valueNode);
}
示例2: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode outputNode, String s) throws Exception {
if(s==null || s.equals("")) {
outputNode.setValue(null);
} else {
outputNode.setValue(s);
}
}
示例3: testQualifier
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
public void testQualifier() throws Exception {
NamespaceDecorator global = new NamespaceDecorator();
NamespaceDecorator qualifier = new NamespaceDecorator();
NamespaceDecorator attribute = new NamespaceDecorator();
global.add(new MockNamespace("global", "http://www.domain.com/global"));
qualifier.add(new MockNamespace("a", "http://www.domain.com/a"));
qualifier.add(new MockNamespace("b", "http://www.domain.com/b"));
qualifier.add(new MockNamespace("c", "http://www.domain.com/c"));
attribute.add(new MockNamespace("d", "http://www.domain.com/d"));
global.set(new MockNamespace("first", "http://www.domain.com/ignore"));
qualifier.set(new MockNamespace("a", "http://www.domain.com/a"));
attribute.set(new MockNamespace("b", "http://www.domain.com/b"));
StringWriter out = new StringWriter();
OutputNode top = NodeBuilder.write(out);
OutputNode root = top.getChild("root");
root.setAttribute("version", "1.0");
qualifier.decorate(root, global);
OutputNode child = root.getChild("child");
child.setAttribute("name", "John Doe");
OutputNode name = child.getAttributes().get("name");
attribute.decorate(name);
OutputNode grandChild = child.getChild("grandChild");
grandChild.setValue("this is the grand child");
root.commit();
validate(out.toString());
}
示例4: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
public void write(OutputNode node, Map map) throws Exception {
Set keys = map.keySet();
for(Object key : keys) {
OutputNode next = node.getChild("entry");
next.setAttribute("key", key.toString());
OutputNode value = next.getChild("value");
value.setValue(map.get(key).toString());
}
}
示例5: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node) throws Exception {
OutputNode child = node.getChild(CODE);
child.setValue(Double.toString(value));
}
示例6: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node) throws Exception {
OutputNode child = node.getChild(CODE);
child.setValue(value);
}
示例7: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node) throws Exception {
OutputNode child = node.getChild(CODE);
child.setValue(Integer.toString(value));
}
示例8: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node) throws Exception {
OutputNode child = node.getChild(CODE);
child.setValue(SIMPLE_ISO8601.format(value));
}
示例9: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node) throws Exception {
OutputNode child = node.getChild(CODE);
child.setValue(Long.toString(value));
}
示例10: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node) throws Exception {
OutputNode child = node.getChild(CODE);
child.setValue(value ? TRUE : FALSE);
}
示例11: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node) throws Exception {
OutputNode child = node.getChild(CODE);
child.setValue(Base64.encodeBytes(value));
}
示例12: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node, String value) throws Exception {
node.setValue(value);
}
示例13: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node, Date value) throws Exception {
String str = dateFormat().format(value);
node.setValue(str);
}
示例14: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(final OutputNode node, final String value) throws Exception {
node.setValue(value);
}
示例15: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode outputNode, Date date) throws Exception {
outputNode.setValue(Helpers.fromDate(date));
}