本文整理汇总了Java中org.simpleframework.xml.stream.OutputNode.getParent方法的典型用法代码示例。如果您正苦于以下问题:Java OutputNode.getParent方法的具体用法?Java OutputNode.getParent怎么用?Java OutputNode.getParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.simpleframework.xml.stream.OutputNode
的用法示例。
在下文中一共展示了OutputNode.getParent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
/**
* The <code>write</code> method writes the fields from the given
* object to the XML element. After this has finished the element
* contains all attributes and sub-elements from the object.
*
* @param object this is the object to be written to the element
* @param node this is the element that is to be populated
*/
public void write(OutputNode node, Object object) throws Exception {
Collection list = (Collection) object;
OutputNode parent = node.getParent();
for(Object item : list) {
primitive.write(parent, item);
}
}
示例2: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
/**
* This <code>write</code> method will write the specified object
* to the given XML element as as list entries. Each entry within
* the given collection must be assignable from the annotated
* type specified within the <code>ElementList</code> annotation.
* Each entry is serialized as a root element, that is, its
* <code>Root</code> annotation is used to extract the name.
*
* @param source this is the source collection to be serialized
* @param node this is the XML element container to be populated
*/
public void write(OutputNode node, Object source) throws Exception {
Collection list = (Collection) source;
OutputNode parent = node.getParent();
if(!node.isCommitted()) {
node.remove();
}
write(parent, list);
}
示例3: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
/**
* This <code>write</code> method will write the specified object
* to the given XML element as as list entries. Each entry within
* the given list must be assignable to the given primitive type.
* This will deserialize each entry type as a primitive value. In
* order to do this the parent string provided forms the element.
*
* @param source this is the source collection to be serialized
* @param node this is the XML element container to be populated
*/
public void write(OutputNode node, Object source) throws Exception {
OutputNode parent = node.getParent();
Mode mode = node.getMode();
if(!node.isCommitted()) {
node.remove();
}
write(parent, source, mode);
}
示例4: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
/**
* This <code>write</code> method will write the key value pairs
* within the provided map to the specified XML node. This will
* write each entry type must contain a key and value so that
* the entry can be deserialized in to the map as a pair. If the
* key or value object is composite it is read as a root object
* so its <code>Root</code> annotation must be present.
*
* @param node this is the node the map is to be written to
* @param source this is the source map that is to be written
*/
public void write(OutputNode node, Object source) throws Exception {
OutputNode parent = node.getParent();
Mode mode = node.getMode();
Map map = (Map) source;
if(!node.isCommitted()) {
node.remove();
}
write(parent, map, mode);
}