/**
 * @license
 * Copyright 2016 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package foam.core2;

import foam.core.Property;
import java.util.ArrayList;
import java.util.List;

public abstract class FObject implements Cloneable {
  public void set(String key, Object value) {}
  public Object get(String key) { return null; }
  public Property getProperty(String key) { return null; }
  public abstract foam.core.Model getModel();
}

@@ -977,10 +977,375 @@
 odel();%0A
+  public List%3CString%3E validateObject() %7B%0A    List%3CString%3E errors = new ArrayList%3CString%3E();%0A    for (Property p : getModel().getProperties()) %7B%0A      if (p.getValidate() != null) %7B%0A        String error = p.getValidate().call(this);%0A        if (error != null) %7B%0A          errors.add(error);%0A        %7D%0A      %7D%0A    %7D%0A    return errors.size() == 0 ? null : errors;%0A  %7D%0A
 %7D%0A

Add a validateObject method to FObject.