本文整理汇总了Java中org.simpleframework.xml.stream.OutputNode.setName方法的典型用法代码示例。如果您正苦于以下问题:Java OutputNode.setName方法的具体用法?Java OutputNode.setName怎么用?Java OutputNode.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.simpleframework.xml.stream.OutputNode
的用法示例。
在下文中一共展示了OutputNode.setName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(Type type, NodeMap<OutputNode> node) throws Exception {
OutputNode outputNode = node.getNode();
if ("DdsRequestObject".equals(outputNode.getName())) {
OutputNode operationNameAtribute = outputNode.getParent().getAttributes().get("DdsOperationName");
outputNode.setName(operationNameAtribute.getValue());
}
}
示例2: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
/**
* The <code>write</code> method uses the name of the XML element to
* select a converter to be used to write the instance. Selection of
* the converter is done by looking up the associated label from
* the union group using the instance type. Once the converter has
* been selected it is used to write the instance.
*
* @param node this is the XML element used to write the instance
* @param item this is the individual list entry to be serialized
* @param label this is the label to used to acquire the converter
*/
private void write(OutputNode node, Object item, Label label) throws Exception {
Converter converter = label.getConverter(context);
Collection list = Collections.singleton(item);
if(!label.isInline()) {
String name = label.getName();
String root = style.getElement(name);
if(!node.isCommitted()) {
node.setName(root);
}
}
converter.write(node, list);
}
示例3: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
/**
* The <code>write</code> method uses the name of the XML element to
* select a converter to be used to write the instance. Selection of
* the converter is done by looking up the associated label from
* the union group using the instance type. Once the converter has
* been selected it is used to write the instance.
*
* @param node this is the XML element used to write the instance
* @param key this is the key associated with the item to write
* @param item this is the value associated with the item to write
* @param label this is the label to used to acquire the converter
*/
private void write(OutputNode node, Object key, Object item, Label label) throws Exception {
Converter converter = label.getConverter(context);
Map map = Collections.singletonMap(key, item);
if(!label.isInline()) {
String name = label.getName();
String root = style.getElement(name);
if(!node.isCommitted()) {
node.setName(root);
}
}
converter.write(node, map);
}
示例4: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
public void write(Type type, NodeMap<OutputNode> node) throws Exception {
OutputNode parent = node.getNode();
String name = parent.getName();
name = name.toUpperCase();
parent.setName(name);
}