1 /*******************************************************************************
\r
2 * Copyright (c) 2010 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.databoard.accessor;
14 import org.simantics.databoard.accessor.error.AccessorConstructionException;
\r
15 import org.simantics.databoard.accessor.error.AccessorException;
\r
16 import org.simantics.databoard.binding.Binding;
\r
17 import org.simantics.databoard.type.Datatype;
\r
18 import org.simantics.databoard.type.VariantType;
\r
21 public interface VariantAccessor extends Accessor {
24 * Get an accessor to the variant's content.
27 * @throws AccessorException
29 <T extends Accessor> T getContentAccessor() throws AccessorConstructionException;
32 * Set the content of this variant.
34 * (Note! this methods sets the _content_ value, in contrast to
35 * {@link Accessor#setValue(org.simantics.databoard.binding.Binding, Object)}
36 * which sets the _variant_ value.
40 * @throws AccessorException
42 void setContentValue(Binding valueBinding, Object value) throws AccessorException;
45 * Get the content of this variant
\r
47 * @param contentBinding
\r
49 * @throws AccessorException
\r
51 Object getContentValue(Binding contentBinding) throws AccessorException;
\r
54 * Get the type of the content
\r
57 * @throws AccessorException
\r
59 Datatype getContentType() throws AccessorException;
62 * Get the type of this variant.
\r
64 * @return VariantType always
\r