本文整理匯總了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;
}
示例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));
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}