]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.document.server/src/org/simantics/document/server/DocumentProperties.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.document.server / src / org / simantics / document / server / DocumentProperties.java
1 /*******************************************************************************
2  * Copyright (c) 2018 Association for Decentralized Information Management in
3  * Industry THTH ry.
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
8  *
9  * Contributors:
10  *     Semantum Oy - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.document.server;
13
14 import java.util.Collection;
15
16 import org.simantics.db.ReadGraph;
17 import org.simantics.db.exception.DatabaseException;
18 import org.simantics.db.layer0.variable.Variable;
19
20 /**
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
24  * scene graph.
25  *
26  * @author Antti Villberg
27  * @since 1.36.0
28  */
29 public interface DocumentProperties {
30
31     /*
32      * Returns the set of attribute keys for the given document component.
33      * Does not return null.
34      */
35     Collection<String> getKeys(ReadGraph graph, Variable component) throws DatabaseException;
36     /*
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.
40      */
41     Object getValue(ReadGraph graph, Variable component, String key) throws DatabaseException;
42
43 }