1 /*******************************************************************************
2 * Copyright (c) 2018 Association for Decentralized Information Management in
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Semantum Oy - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.document.server;
14 import java.util.Collection;
16 import org.simantics.db.ReadGraph;
17 import org.simantics.db.exception.DatabaseException;
18 import org.simantics.db.layer0.variable.Variable;
21 * This interface abstracts the computation of document component properties.
22 * The key,value -pairs returned by this interface are used to build the
23 * org.simantics.document.server.JSONObject values used in the document
26 * @author Antti Villberg
29 public interface DocumentProperties {
32 * Returns the set of attribute keys for the given document component.
33 * Does not return null.
35 Collection<String> getKeys(ReadGraph graph, Variable component) throws DatabaseException;
37 * Returns a value for a key in the key set.
38 * Null values are allowed and normal DatabaseException
39 * are thrown when evaluating the value.
41 Object getValue(ReadGraph graph, Variable component, String key) throws DatabaseException;