1 /*******************************************************************************
2 * Copyright (c) 2010 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 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.databoard.accessor;
14 import org.simantics.databoard.accessor.error.AccessorConstructionException;
15 import org.simantics.databoard.accessor.error.AccessorException;
16 import org.simantics.databoard.binding.Binding;
17 import org.simantics.databoard.type.Datatype;
18 import org.simantics.databoard.type.VariantType;
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
47 * @param contentBinding
49 * @throws AccessorException
51 Object getContentValue(Binding contentBinding) throws AccessorException;
54 * Get the type of the content
57 * @throws AccessorException
59 Datatype getContentType() throws AccessorException;
62 * Get the type of this variant.
64 * @return VariantType always