コード例 #1
0
 @Override
 public Trigger copy(String uuid) {
   try {
     Trigger t = get(uuid).clone();
     t.setName("Copy of " + t.getName());
     create(t);
     return t;
   } catch (Exception e) {
     return null;
   }
 }
コード例 #2
0
ファイル: Trigger_Drawn.java プロジェクト: GarikRC/arcane
  @Override
  public Trigger getCopy() {
    Trigger copy = new Trigger_Drawn(mapParams, hostCard);
    if (overridingAbility != null) {
      copy.setOverridingAbility(overridingAbility);
    }
    copy.setName(name);
    copy.setID(ID);

    return copy;
  }
コード例 #3
0
  public Trigger unmarshall(StaxUnmarshallerContext context) throws Exception {
    Trigger trigger = new Trigger();
    int originalDepth = context.getCurrentDepth();
    int targetDepth = originalDepth + 1;

    if (context.isStartOfDocument()) targetDepth += 1;

    while (true) {
      XMLEvent xmlEvent = context.nextEvent();
      if (xmlEvent.isEndDocument()) return trigger;

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {

        if (context.testExpression("Name", targetDepth)) {
          trigger.setName(StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return trigger;
        }
      }
    }
  }