Пример #1
0
  @Override
  public boolean setValue(Object target, String attrName, Object value, String type) {
    if (JsonIdMap.REMOVE.equals(type)) {
      attrName = attrName + type;
    }

    if (Clazz.PROPERTY_CLASSMODEL.equalsIgnoreCase(attrName)) {
      ((Clazz) target).with((ClassModel) value);
      return true;
    }

    if (Clazz.PROPERTY_ATTRIBUTES.equalsIgnoreCase(attrName)) {
      ((Clazz) target).with((Attribute) value);
      return true;
    }

    if ((Clazz.PROPERTY_ATTRIBUTES + JsonIdMap.REMOVE).equalsIgnoreCase(attrName)) {
      ((Clazz) target).without((Attribute) value);
      return true;
    }

    if (Clazz.PROPERTY_METHODS.equalsIgnoreCase(attrName)) {
      ((Clazz) target).with((Method) value);
      return true;
    }

    if ((Clazz.PROPERTY_METHODS + JsonIdMap.REMOVE).equalsIgnoreCase(attrName)) {
      ((Clazz) target).without((Method) value);
      return true;
    }

    if (Clazz.PROPERTY_ROLES.equalsIgnoreCase(attrName)) {
      ((Clazz) target).with((Role) value);
      return true;
    }

    if ((Clazz.PROPERTY_ROLES + JsonIdMap.REMOVE).equalsIgnoreCase(attrName)) {
      ((Clazz) target).without((Role) value);
      return true;
    }

    if (Clazz.PROPERTY_SUPERCLAZZES.equalsIgnoreCase(attrName)) {
      ((Clazz) target).withSuperClazz((Clazz) value);
      return true;
    }

    if ((Clazz.PROPERTY_SUPERCLAZZES + JsonIdMap.REMOVE).equalsIgnoreCase(attrName)) {
      ((Clazz) target).setInterface((Boolean) value);
      return true;
    }

    if (Clazz.PROPERTY_EXTERNAL.equalsIgnoreCase(attrName)) {
      ((Clazz) target).setExternal((Boolean) value);
      return true;
    }

    if (Clazz.PROPERTY_KIDCLAZZES.equalsIgnoreCase(attrName)) {
      ((Clazz) target).withKidClazzes((Clazz) value);
      return true;
    }

    if ((Clazz.PROPERTY_KIDCLAZZES + JsonIdMap.REMOVE).equalsIgnoreCase(attrName)) {
      ((Clazz) target).withoutKidClazz((Clazz) value);
      return true;
    }

    if (Clazz.PROPERTY_INTERFAZE.equalsIgnoreCase(attrName)) {
      ((Clazz) target).setInterface((Boolean) value);
      return true;
    }

    if (Clazz.PROPERTY_ANNOTATIONS.equalsIgnoreCase(attrName)) {
      ((Clazz) target).withAnnotation((Annotation) value);
      return true;
    }

    if ((Clazz.PROPERTY_ANNOTATIONS + JsonIdMap.REMOVE).equalsIgnoreCase(attrName)) {
      ((Clazz) target).withoutAnnotation((Annotation) value);
      return true;
    }
    return super.setValue(target, attrName, value, type);
  }
Пример #2
0
 @Override
 public void removeObject(Object entity) {
   ((Clazz) entity).removeYou();
 }