コード例 #1
0
  @Override
  public boolean setValue(Object target, String attrName, Object value, String type) {
    if (JsonIdMap.REMOVE.equals(type) && value != null) {
      attrName = attrName + type;
    }

    if (SeppelScope.PROPERTY_SCOPENAME.equalsIgnoreCase(attrName)) {
      ((SeppelScope) target).withScopeName((String) value);
      return true;
    }

    if (SeppelScope.PROPERTY_SUBSCOPES.equalsIgnoreCase(attrName)) {
      ((SeppelScope) target).withSubScopes((SeppelScope) value);
      return true;
    }

    if ((SeppelScope.PROPERTY_SUBSCOPES + JsonIdMap.REMOVE).equalsIgnoreCase(attrName)) {
      ((SeppelScope) target).withoutSubScopes((SeppelScope) value);
      return true;
    }

    if (SeppelScope.PROPERTY_SUPERSCOPES.equalsIgnoreCase(attrName)) {
      ((SeppelScope) target).withSuperScopes((SeppelScope) value);
      return true;
    }

    if ((SeppelScope.PROPERTY_SUPERSCOPES + JsonIdMap.REMOVE).equalsIgnoreCase(attrName)) {
      ((SeppelScope) target).withoutSuperScopes((SeppelScope) value);
      return true;
    }

    if (SeppelScope.PROPERTY_SPACES.equalsIgnoreCase(attrName)) {
      ((SeppelScope) target).withSpaces((SeppelSpaceProxy) value);
      return true;
    }

    if ((SeppelScope.PROPERTY_SPACES + JsonIdMap.REMOVE).equalsIgnoreCase(attrName)) {
      ((SeppelScope) target).withoutSpaces((SeppelSpaceProxy) value);
      return true;
    }

    if (SeppelScope.PROPERTY_OBSERVEDOBJECTS.equalsIgnoreCase(attrName)) {
      ((SeppelScope) target).withObservedObjects((Object) value);
      return true;
    }

    if ((SeppelScope.PROPERTY_OBSERVEDOBJECTS + JsonIdMap.REMOVE).equalsIgnoreCase(attrName)) {
      ((SeppelScope) target).withoutObservedObjects((Object) value);
      return true;
    }

    return false;
  }
コード例 #2
0
 @Override
 public void removeObject(Object entity) {
   ((SeppelScope) entity).removeYou();
 }