示例#1
0
  public ERD2WExtendedRule cloneRule() {
    EOKeyValueArchiver archiver = new EOKeyValueArchiver();
    encodeWithKeyValueArchiver(archiver);
    EOKeyValueUnarchiver unarchiver = new EOKeyValueUnarchiver(archiver.dictionary());

    return new ERD2WExtendedRule(unarchiver);
  }
示例#2
0
 public void encodeWithKeyValueArchiver(EOKeyValueArchiver eokeyvaluearchiver) {
   super.encodeWithKeyValueArchiver(eokeyvaluearchiver);
   if (mutableUserInfo != null && mutableUserInfo.allKeys().count() > 0)
     eokeyvaluearchiver.encodeObject(mutableUserInfo, "userInfo");
   ((NSMutableDictionary) eokeyvaluearchiver.dictionary())
       .setObjectForKey("com.webobjects.directtoweb.Rule", "class");
 }
  protected static String encode(NSArray rules) {
    if (rules != null) {
      EOKeyValueArchiver archiver = new EOKeyValueArchiver();

      archiver.encodeObject(rules, RuleModel.RULES_KEY);

      return NSPropertyListSerialization.stringFromPropertyList(
          transformDictionary(archiver.dictionary(), RuleModelUtilities.compressionLookup()));
    } else {
      return null;
    }
  }
示例#4
0
 public String objectAsString(Rule o) {
   EOKeyValueArchiver eokeyvaluearchiver = new EOKeyValueArchiver();
   o.encodeWithKeyValueArchiver(eokeyvaluearchiver);
   return NSPropertyListSerialization.stringFromPropertyList(eokeyvaluearchiver.dictionary());
 }