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


Java Attribute类代码示例

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


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

示例1: Pod

import org.simpleframework.xml.Attribute; //导入依赖的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: testMixedAnnotationsWithNoDefaults

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

示例3: getInstance

import org.simpleframework.xml.Attribute; //导入依赖的package包/类
/**
 * This is used to create an annotation for the provided type.
 * Annotations created are used to match the type provided. So
 * an array of objects will have an <code>ElementArray</code>
 * annotation for example. Matching the annotation to the
 * type ensures the best serialization for that type. 
 * 
 * @param type the type to create the annotation for
 * 
 * @return this returns the synthetic annotation to be used
 */
private Annotation getInstance(Class type) throws Exception {
   ClassLoader loader = getClassLoader();
   Class entry = type.getComponentType();
   
   if(type.isArray()) {
      if(isPrimitive(entry)) {
         return getInstance(loader, Element.class);
      }
      return getInstance(loader, ElementArray.class);
   }
   if(isPrimitive(type) && isAttribute()) {
      return getInstance(loader, Attribute.class);
   }
   return getInstance(loader, Element.class);
}
 
开发者ID:ngallagher,项目名称:simplexml,代码行数:27,代码来源:AnnotationFactory.java

示例4: Wahlzettel

import org.simpleframework.xml.Attribute; //导入依赖的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

示例5: Alternative

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

示例6: StateList

import org.simpleframework.xml.Attribute; //导入依赖的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

示例7: States

import org.simpleframework.xml.Attribute; //导入依赖的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

示例8: Assumption

import org.simpleframework.xml.Attribute; //导入依赖的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

示例9: SubPod

import org.simpleframework.xml.Attribute; //导入依赖的package包/类
public SubPod(@Element(name = "plaintext") final String plaintext,
              @Attribute(name = "title") final String title,
              @Element(name = "imagesource", required = false) final String imagesource) {
    this.plaintext = plaintext;
    this.title = title;
    this.imagesource = imagesource;
}
 
开发者ID:brandall76,项目名称:Saiy-PS,代码行数:8,代码来源:SubPod.java

示例10: SpellCheck

import org.simpleframework.xml.Attribute; //导入依赖的package包/类
public SpellCheck(@Attribute(name = "suggestion") final String suggestion,
                  @Attribute(name = "text") final String text,
                  @Attribute(name = "word") final String word) {
    this.suggestion = suggestion;
    this.text = text;
    this.word = word;
}
 
开发者ID:brandall76,项目名称:Saiy-PS,代码行数:8,代码来源:SpellCheck.java

示例11: Warnings

import org.simpleframework.xml.Attribute; //导入依赖的package包/类
public Warnings(@Attribute(name = "count") final long count,
                @Element(name = "reinterpret", required = false) final Reinterpret reinterpret,
                @Element(name = "spellcheck", required = false) final SpellCheck spellcheck) {
    this.count = count;
    this.reinterpret = reinterpret;
    this.spellcheck = spellcheck;
}
 
开发者ID:brandall76,项目名称:Saiy-PS,代码行数:8,代码来源:Warnings.java

示例12: Reinterpret

import org.simpleframework.xml.Attribute; //导入依赖的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: OObject

import org.simpleframework.xml.Attribute; //导入依赖的package包/类
public OObject(@Attribute(required = true, name = "O_id") String O_id, 
		@Element(required = true, name = "C") Type C,
		IDomain parent) {
	super();
	this.O_id = O_id;
	this.C = C;

	// parent is the parent domain of this
	this.parent = parent;

	// NOTE: would be hackish to do the following:
	// parentDomain.addObject(this);
}
 
开发者ID:aroog,项目名称:code,代码行数:14,代码来源:OObject.java

示例14: ODFEdge

import org.simpleframework.xml.Attribute; //导入依赖的package包/类
public ODFEdge(@Element(required = true, name = "osrc") OObject osrc,
		@Element(required = true, name = "odst") OObject odst,
		@Element(required = true, name = "flow") OObject flow,
		@Attribute(required = true, name = "flag") EdgeFlag flag) {
	super(osrc, odst);
	this.flow = flow;
	this.flag = flag;
}
 
开发者ID:aroog,项目名称:code,代码行数:9,代码来源:ODFEdge.java

示例15: RenameDomain

import org.simpleframework.xml.Attribute; //导入依赖的package包/类
/**
 * Use this constructor when loading from file
 * @param srcObject
 * @param dstDomain
 */
public RenameDomain(@Attribute(name = "srcObject") String srcObject,
							@Attribute(name = "oldDomainName") String oldDomainName,	
							@Attribute(name = "newDomainName") String newDomainName) {
    super();
    this.srcObject = srcObject;
    this.oldDomainName = oldDomainName;
    this.newDomainName = newDomainName;
   }
 
开发者ID:aroog,项目名称:code,代码行数:14,代码来源:RenameDomain.java


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