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


Java Style.getAttribute方法代码示例

本文整理汇总了Java中org.simpleframework.xml.stream.Style.getAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java Style.getAttribute方法的具体用法?Java Style.getAttribute怎么用?Java Style.getAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.simpleframework.xml.stream.Style的用法示例。


在下文中一共展示了Style.getAttribute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: assembleAttributes

import org.simpleframework.xml.stream.Style; //导入方法依赖的package包/类
/**
 * This is used to assemble the model by perform registrations
 * based on the <code>Order</code> annotation. The initial
 * registrations performed by this establish the element and
 * attribute order for serialization of the schema class.
 * 
 * @param model the model to perform registrations on
 * @param order this is the order specified by the class   
 */
private void assembleAttributes(Model model, Order order) throws Exception {
   for(String value : order.attributes()) {
      Expression path = builder.build(value);
      
      if(!path.isAttribute() && path.isPath()) {
         throw new PathException("Ordered attribute '%s' references an element in %s", path, detail);
      }
      if(!path.isPath()) {
         Style style = format.getStyle();
         String name = style.getAttribute(value);
         
         model.registerAttribute(name);
      } else {
      registerAttributes(model, path);         
      }
   }
}
 
开发者ID:ngallagher,项目名称:simplexml,代码行数:27,代码来源:ModelAssembler.java

示例2: getName

import org.simpleframework.xml.stream.Style; //导入方法依赖的package包/类
/**
 * This is used to acquire the name of the element or attribute
 * that is used by the class schema. The name is determined by
 * checking for an override within the annotation. If it contains
 * a name then that is used, if however the annotation does not
 * specify a name the the field or method name is used instead.
 *
 * @return returns the name that is used for the XML property
 */
public String getName() throws Exception {
   Style style = format.getStyle();
   String name = detail.getName();
   
   return style.getAttribute(name);
}
 
开发者ID:ngallagher,项目名称:simplexml,代码行数:16,代码来源:VersionLabel.java


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