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


Java ElementList类代码示例

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


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

示例1: Pod

import org.simpleframework.xml.ElementList; //导入依赖的package包/类
public Pod(@Attribute(name = "error") final boolean error,
           @Attribute(name = "primary") final boolean primary,
           @Attribute(name = "title") final String title,
           @Attribute(name = "scanner") final String scanner,
           @Attribute(name = "id") final String id,
           @Attribute(name = "position") final long position,
           @Attribute(name = "numsubpods") final long numsubpods,
           @ElementList(inline = true, name = "subpods") final List<SubPod> subpods,
           @Element(name = "states") final States states,
           @Element(name = "infos") final Infos infos,
           @Element(name = "definitions", required = false) final Definitions definitions) {
    this.error = error;
    this.title = title;
    this.scanner = scanner;
    this.id = id;
    this.position = position;
    this.numsubpods = numsubpods;
    this.subpods = subpods;
    this.primary = primary;
    this.states = states;
    this.infos = infos;
    this.definitions = definitions;
}
 
开发者ID:brandall76,项目名称:Saiy-PS,代码行数:24,代码来源:Pod.java

示例2: testParser

import org.simpleframework.xml.ElementList; //导入依赖的package包/类
public void testParser() throws Exception {
   assertEquals("http://util.java/HashMap", parse(HashMap.class));
   assertEquals("http://simpleframework.org/xml/Element", parse(Element.class));
   assertEquals("http://simpleframework.org/xml/ElementList", parse(ElementList.class));
   assertEquals("http://w3c.org/dom/Node", parse(Node.class));
   assertEquals("http://simpleframework.org/xml/strategy/PackageParser", parse(PackageParser.class));
   
   assertEquals(HashMap.class, revert("http://util.java/HashMap"));
   assertEquals(Element.class, revert("http://simpleframework.org/xml/Element"));
   assertEquals(ElementList.class, revert("http://simpleframework.org/xml/ElementList"));
   assertEquals(Node.class, revert("http://w3c.org/dom/Node"));
   assertEquals(PackageParser.class, revert("http://simpleframework.org/xml/strategy/PackageParser"));
   
   long start = System.currentTimeMillis();
   for(int i = 0; i < ITERATIONS; i++) {
      fastParse(ElementList.class);
   }
   long fast = System.currentTimeMillis() - start;
   start = System.currentTimeMillis();
   for(int i = 0; i < ITERATIONS; i++) {
      parse(ElementList.class);
   }
   long normal = System.currentTimeMillis() - start;
   System.out.printf("fast=%sms normal=%sms diff=%s%n", fast, normal, normal / fast);
}
 
开发者ID:ngallagher,项目名称:simplexml,代码行数:26,代码来源:PackageParserTest.java

示例3: testMixedAnnotations

import org.simpleframework.xml.ElementList; //导入依赖的package包/类
public void testMixedAnnotations() throws Exception {
   Map<String, Contact> map = getContacts(MixedAnnotations.class);
   
   assertEquals(map.size(), 3);
   assertFalse(map.get("name").isReadOnly());
   assertFalse(map.get("value").isReadOnly());
   assertFalse(map.get("list").isReadOnly());
   
   assertEquals(String.class, map.get("name").getType());
   assertEquals(int.class, map.get("value").getType());
   assertEquals(List.class, map.get("list").getType());
   
   assertEquals(Element.class, map.get("name").getAnnotation().annotationType());
   assertEquals(Attribute.class, map.get("value").getAnnotation().annotationType());
   assertEquals(ElementList.class, map.get("list").getAnnotation().annotationType());
   
   assertEquals(Element.class, map.get("name").getAnnotation(Element.class).annotationType());
   assertEquals(Attribute.class, map.get("value").getAnnotation(Attribute.class).annotationType());
   assertEquals(ElementList.class, map.get("list").getAnnotation(ElementList.class).annotationType());
   
   assertNull(map.get("name").getAnnotation(Root.class));
   assertNull(map.get("value").getAnnotation(Root.class));
   assertNull(map.get("list").getAnnotation(Root.class));
}
 
开发者ID:ngallagher,项目名称:simplexml,代码行数:25,代码来源:FieldScannerDefaultTest.java

示例4: ComplicatedExample

import org.simpleframework.xml.ElementList; //导入依赖的package包/类
public ComplicatedExample(
      @Path("x:path[1]") @ElementMap(name="a") Map<Key, Entry> map,
      @Path("x:path[2]") @ElementList(name="a") List<Entry> list,
      @Element(name="elementOne") String elementOne,
      @Element(name="elementTwo") String elementTwo,
      @Element(name="elementThree") String elementThree,
      @Text String text,
      @Path("x:path[2]/x:someOtherPath") @Attribute(name="attribute_one") String attribute_one,
      @Path("x:path[2]/x:someOtherPath") @Attribute(name="attribute_two") String attribute_two) 
{
   this.map = map;
   this.list = list;
   this.elementOne = elementOne;
   this.elementTwo = elementTwo;
   this.elementThree = elementThree;
   this.text = text;
   this.attribute_one = attribute_one;
   this.attribute_two = attribute_two;
}
 
开发者ID:ngallagher,项目名称:simplexml,代码行数:20,代码来源:UnionComplicatedPathMixTest.java

示例5: Wahlzettel

import org.simpleframework.xml.ElementList; //导入依赖的package包/类
/**
 * Konstruktor nur f�r das Laden der XML Dateien. Da m�ssen alle Angaben
 * gemacht werden, die in der XML gespeichert sind.
 * 
 * @param id
 * @param valid
 * @param stimmen
 * @param commited
 */
public Wahlzettel(@Attribute(name = "id") int id,
		@Attribute(name = "valid") boolean valid,
		@ElementList(name = "stimmen") ArrayList<Stimme> stimmen,
		@Attribute(name = "commited") int commited,
		@Attribute(name = "party") int party) {
	this.id = id;
	this.rc = new RegelChecker();
	this.stimmen = stimmen;
	this.valid = valid;
	this.commited = commited;
	this.party=party;
	//sortieren:
	Collections.sort(stimmen);

}
 
开发者ID:SecUSo,项目名称:EasyVote,代码行数:25,代码来源:Wahlzettel.java

示例6: Device

import org.simpleframework.xml.ElementList; //导入依赖的package包/类
public Device(
    @Element    (name="deviceType"            ) String     deviceType      ,
    @Element    (name="friendlyName"          ) String     friendlyName    ,
    @Element    (name="manufacturer"          ) String     manufacturer    ,
    @Element    (name="manufacturerURL"       ) String     manufacturerUrl ,
    @Element    (name="modelDescription"      ) String     modelDescription,
    @Element    (name="modelName"             ) String     modelName       ,
    @Element    (name="modelNumber"           ) String     modelNumber     ,
    @Element    (name="modelURL"              ) String     modelUrl        ,
    @Element    (name="serialNumber"          ) String     serialNumber    ,
    @Element    (name="UDN"                   ) String     udn             ,
    @Element    (name="presentationURL"       ) String     presentationUrl ,
    @ElementList(name="iconList", entry="icon") List<Icon> iconList        ) {
    this.deviceType       = deviceType;
    this.friendlyName     = friendlyName;
    this.manufacturer     = manufacturer;
    this.manufacturerUrl  = manufacturerUrl;
    this.modelDescription = modelDescription;
    this.modelName        = modelName;
    this.modelNumber      = modelNumber;
    this.modelUrl         = modelUrl;
    this.serialNumber     = serialNumber;
    this.udn              = udn;
    this.presentationUrl  = presentationUrl;
    this.iconList         = ImmutableList.copyOf(iconList);
}
 
开发者ID:caprica,项目名称:brue,代码行数:27,代码来源:Device.java

示例7: Episode

import org.simpleframework.xml.ElementList; //导入依赖的package包/类
public Episode(@Element(name = "title")String title, @Element(name = "link")String link, @Element(name = "description")String description, @Element(name = "publisher", required = false)String publisher, @Element(name = "content")MediaContent content, @ElementList(name = "thumbnail", inline = true, required = false)List<Thumbnail> thumbnail) {
    this.title = title;
    this.link = link;
    this.description = description;
    this.publisher = publisher;
    this.content = content;
    this.thumbnail = thumbnail;
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:9,代码来源:Episode.java

示例8: Channel

import org.simpleframework.xml.ElementList; //导入依赖的package包/类
public Channel(@Element(name = "title")String title, @Path("link") @Text(required=false)String link, @Element(name = "description")String description, @Element(name = "copyright")String copyright, @ElementList(name = "episode", inline = true)List<Episode> episode) {
    this.title = title;
    this.link = link;
    this.description = description;
    this.copyright = copyright;
    this.episode = episode;
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:8,代码来源:Channel.java

示例9: StateList

import org.simpleframework.xml.ElementList; //导入依赖的package包/类
public StateList(@Attribute(name = "count") final long count,
                 @Attribute(name = "delimiters", required = false) final String delimiters,
                 @ElementList(inline = true, name = "state") final List<State> state,
                 @Attribute(name = "value", required = false) final String value) {
    this.count = count;
    this.delimiters = delimiters;
    this.state = state;
    this.value = value;
}
 
开发者ID:brandall76,项目名称:Saiy-PS,代码行数:10,代码来源:StateList.java

示例10: States

import org.simpleframework.xml.ElementList; //导入依赖的package包/类
public States(@Attribute(name = "count") final long count,
              @ElementList(inline = true, name = "state") final List<State> state,
              @Element(name = "statelist", required = false) final StateList stateList) {
    this.count = count;
    this.state = state;
    this.stateList = stateList;
}
 
开发者ID:brandall76,项目名称:Saiy-PS,代码行数:8,代码来源:States.java

示例11: Assumption

import org.simpleframework.xml.ElementList; //导入依赖的package包/类
public Assumption(@Attribute(name = "count") final long count,
                  @Attribute(name = "template", required = false) final String template,
                  @Attribute(name = "type") final String type,
                  @ElementList(inline = true, name = "value") final List<Value> values,
                  @Attribute(name = "word", required = false) final String word,
                  @Attribute(name = "current", required = false) final long current,
                  @Attribute(name = "desc", required = false) final String desc) {
    this.count = count;
    this.template = template;
    this.type = type;
    this.values = values;
    this.word = word;
    this.current = current;
    this.desc = desc;
}
 
开发者ID:brandall76,项目名称:Saiy-PS,代码行数:16,代码来源:Assumption.java

示例12: Reinterpret

import org.simpleframework.xml.ElementList; //导入依赖的package包/类
public Reinterpret(@Attribute(name = "level", required = false) final String level,
                   @Attribute(name = "new", required = false) final String replaced,
                   @Attribute(name = "score", required = false) final double score,
                   @Attribute(name = "text", required = false) final String text,
                   @ElementList(inline = true, name = "alternative", required = false)
                   final List<Alternative> alternatives) {
    this.level = level;
    this.replaced = replaced;
    this.score = score;
    this.text = text;
    this.alternatives = alternatives;
}
 
开发者ID:brandall76,项目名称:Saiy-PS,代码行数:13,代码来源:Reinterpret.java

示例13: ElementListLabel

import org.simpleframework.xml.ElementList; //导入依赖的package包/类
/**
 * Constructor for the <code>ElementListLabel</code> object. This
 * creates a label object, which can be used to convert an XML 
 * node to a <code>Collection</code> of XML serializable objects.
 * 
 * @param contact this is the contact that this label represents
 * @param label the annotation that contains the schema details
 * @param format this is used to style the elements in the list
 */
public ElementListLabel(Contact contact, ElementList label, Format format) {
   this.detail = new Introspector(contact, this, format);
   this.decorator = new Qualifier(contact);
   this.required = label.required();
   this.type = contact.getType();
   this.override = label.name();  
   this.inline = label.inline();
   this.entry = label.entry();
   this.data = label.data();
   this.item = label.type();
   this.format = format;
   this.label = label;
}
 
开发者ID:ngallagher,项目名称:simplexml,代码行数:23,代码来源:ElementListLabel.java

示例14: scan

import org.simpleframework.xml.ElementList; //导入依赖的package包/类
/**
 * This reflectively checks the annotation to determine the type 
 * of annotation it represents. If it represents an XML schema
 * annotation it is used to create a <code>Contact</code> which 
 * can be used to represent the field within the source object.
 * 
 * @param field the field that the annotation comes from
 * @param label the annotation used to model the XML schema
 * @param list this is the list of annotations on the field
 */
private void scan(Field field, Annotation label, Annotation[] list) {
   if(label instanceof Attribute) {
      process(field, label, list);
   }
   if(label instanceof ElementUnion) {
      process(field, label, list);
   }
   if(label instanceof ElementListUnion) {
      process(field, label, list);
   }
   if(label instanceof ElementMapUnion) {
      process(field, label, list);
   }
   if(label instanceof ElementList) {
      process(field, label, list);
   }     
   if(label instanceof ElementArray) {
      process(field, label, list);
   }
   if(label instanceof ElementMap) {
      process(field, label, list);
   }
   if(label instanceof Element) {
      process(field, label, list);
   }       
   if(label instanceof Version) {
      process(field, label, list);
   }
   if(label instanceof Text) {
      process(field, label, list);
   }
   if(label instanceof Transient) {
      remove(field, label);
   }
}
 
开发者ID:ngallagher,项目名称:simplexml,代码行数:46,代码来源:FieldScanner.java

示例15: ElementListParameter

import org.simpleframework.xml.ElementList; //导入依赖的package包/类
/**   
 * Constructor for the <code>ElementListParameter</code> object.
 * This is used to create a parameter that can be used to 
 * determine a consistent name using the provided XML annotation.
 * 
 * @param factory this is the constructor the parameter is in
 * @param value this is the annotation used for the parameter
 * @param format this is the format used to style this parameter
 * @param index this is the index the parameter appears at
 */
public ElementListParameter(Constructor factory, ElementList value, Format format, int index) throws Exception {
   this.contact = new Contact(value, factory, index);
   this.label = new ElementListLabel(contact, value, format);
   this.expression = label.getExpression();
   this.path = label.getPath();
   this.type = label.getType();
   this.name = label.getName();
   this.key = label.getKey();
   this.index = index;
}
 
开发者ID:ngallagher,项目名称:simplexml,代码行数:21,代码来源:ElementListParameter.java


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