1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
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 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.db.layer0.request;
14 import org.simantics.db.ReadGraph;
15 import org.simantics.db.Resource;
16 import org.simantics.db.common.exception.DebugException;
17 import org.simantics.db.common.request.TernaryRead;
18 import org.simantics.db.exception.AdaptionException;
19 import org.simantics.db.exception.DatabaseException;
20 import org.simantics.db.exception.ResourceNotFoundException;
21 import org.simantics.db.layer0.adapter.Valuations;
23 public class PossibleSelectedValuation extends TernaryRead<Resource, String, String, Resource> {
25 public PossibleSelectedValuation(Resource resource, String valuation) {
26 super(resource, valuation, "");
29 public PossibleSelectedValuation(Resource resource, String valuation, String suffix) {
30 super(resource, valuation, suffix);
34 public Resource perform(ReadGraph graph) throws DatabaseException {
37 Valuations valuations = graph.adapt(parameter, Valuations.class);
39 return valuations.getValue(graph, null, parameter2, parameter3);
41 } catch (ResourceNotFoundException e) {
42 if (DebugException.DEBUG)
45 } catch (AdaptionException e) {
46 if (DebugException.DEBUG)