当前位置: 首页>>代码示例>>Java>>正文


Java OutputNode.setData方法代码示例

本文整理汇总了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);
      }
   }
}
 
开发者ID:ngallagher,项目名称:simplexml,代码行数:38,代码来源:Composite.java

示例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());
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:6,代码来源:RecordingStatusConverter.java

示例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()));
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:6,代码来源:OmCalendarConverter.java

示例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));
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:7,代码来源:DateConverter.java

示例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());
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:7,代码来源:BaseFileItemConverter.java

示例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()));
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:6,代码来源:PollTypeConverter.java

示例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()));
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:6,代码来源:AppointmentReminderTypeConverter.java

示例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()));
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:6,代码来源:SalutationConverter.java

示例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());
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:6,代码来源:AppointmentConverter.java

示例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()));
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:6,代码来源:RoomTypeConverter.java

示例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());
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:6,代码来源:UserConverter.java

示例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());
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:6,代码来源:GroupConverter.java

示例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());
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:6,代码来源:RoomConverter.java

示例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);        
   }
}
 
开发者ID:ngallagher,项目名称:simplexml,代码行数:21,代码来源:Composite.java


注:本文中的org.simpleframework.xml.stream.OutputNode.setData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。