本文整理汇总了Java中org.simpleframework.xml.stream.OutputNode.setData方法的典型用法代码示例。如果您正苦于以下问题:Java OutputNode.setData方法的具体用法?Java OutputNode.setData怎么用?Java OutputNode.setData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.simpleframework.xml.stream.OutputNode
的用法示例。
在下文中一共展示了OutputNode.setData方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeElement
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
/**
* This write method is used to append the provided object as an
* element to the given XML element object. This will recursively
* write the contacts from the provided object as elements. This is
* done using the <code>Converter</code> acquired from the contact
* label. If the type of the contact value is not of the same
* type as the XML schema class a "class" attribute is appended.
* <p>
* If the element being written is inline, then this will not
* check to see if there is a "class" attribute specifying the
* name of the class. This is because inline elements do not have
* an outer class and thus could never have an override.
*
* @param value this is the value to be set as an element
* @param node this is the XML element to write the element to
* @param label the label that contains the contact details
*/
private void writeElement(OutputNode node, Object value, Label label) throws Exception {
if(value != null) {
Class real = value.getClass();
Label match = label.getLabel(real);
String name = match.getName();
Type type = label.getType(real);
OutputNode next = node.getChild(name);
if(!match.isInline()) {
writeNamespaces(next, type, match);
}
if(match.isInline() || !isOverridden(next, value, type)) {
Converter convert = match.getConverter(context);
boolean data = match.isData();
next.setData(data);
writeElement(next, value, convert);
}
}
}
示例2: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node, Recording.Status value) throws Exception {
node.setData(true);
node.setValue(value == null ? Status.NONE.name() : value.name());
}
示例3: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node, OmCalendar value) throws Exception {
node.setData(true);
node.setValue(value == null ? "0" : String.valueOf(value.getId()));
}
示例4: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node, Date value) throws Exception {
node.setAttribute(ATTR_CLASS, "java.util.Date");
node.setData(true);
node.setValue(value == null ? "0" : CalendarPatterns.getExportDate(value));
}
示例5: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node, BaseFileItem value) throws Exception {
node.setData(true);
node.getAttributes().forEach(name -> node.getAttributes().remove(name));
node.setValue(value == null ? "0" : "" + value.getId());
}
示例6: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node, RoomPoll.Type value) throws Exception {
node.setData(true);
node.setValue(value == null ? "0" : String.valueOf(value.getId()));
}
示例7: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node, Reminder value) throws Exception {
node.setData(true);
node.setValue(value == null ? "0" : String.valueOf(value.getId()));
}
示例8: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node, Salutation value) throws Exception {
node.setData(true);
node.setValue(value == null ? "0" : String.valueOf(value.getId()));
}
示例9: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node, Appointment value) throws Exception {
node.setData(true);
node.setValue(value == null ? "0" : "" + value.getId());
}
示例10: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node, Type value) throws Exception {
node.setData(true);
node.setValue(value == null ? "0" : String.valueOf(value.getId()));
}
示例11: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node, User value) throws Exception {
node.setData(true);
node.setValue(value == null ? "0" : "" + value.getId());
}
示例12: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node, Group value) throws Exception {
node.setData(true);
node.setValue(value == null ? "0" : "" + value.getId());
}
示例13: write
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
@Override
public void write(OutputNode node, Room value) throws Exception {
node.setData(true);
node.setValue(value == null ? "0" : "" + value.getId());
}
示例14: writeText
import org.simpleframework.xml.stream.OutputNode; //导入方法依赖的package包/类
/**
* This write method is used to set the value of the provided object
* as the text for the XML element. This will acquire the string
* value of the object using <code>toString</code> only if the
* object provided is not an enumerated type. If the object is an
* enumerated type then the <code>Enum.name</code> method is used.
*
* @param value this is the value to set as the XML element text
* @param node this is the XML element to write the text value to
* @param label the label that contains the contact details
*/
private void writeText(OutputNode node, Object value, Label label) throws Exception {
if(value != null && !label.isTextList()) {
String text = factory.getText(value);
boolean data = label.isData();
node.setData(data);
node.setValue(text);
}
}