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.binding.reflection;
14 import org.simantics.databoard.binding.Binding;
15 import org.simantics.databoard.binding.RecordBinding;
16 import org.simantics.databoard.binding.error.BindingException;
17 import org.simantics.databoard.type.Datatype;
18 import org.simantics.databoard.type.RecordType;
21 * Binds void.class to {}
23 public class VoidBinding extends RecordBinding {
25 public static final Binding VOID_BINDING = new VoidBinding();
27 public VoidBinding() {
28 this.type = RecordType.VOID_TYPE;
29 this.componentBindings = new Binding[0];
33 public Object create(Object... value) throws BindingException {
38 public Object getComponent(Object obj, int index)
39 throws BindingException {
40 throw new BindingException();
44 public Object createPartial() throws BindingException {
49 public void readFrom(Binding srcBinding, Object src, Object dst)
50 throws BindingException {
54 public void setComponents(Object obj, Object... value)
55 throws BindingException {
56 if (value.length==0) return;
57 throw new BindingException();
61 public void setComponent(Object obj, int index, Object value)
62 throws BindingException {
63 throw new BindingException();
67 public boolean isInstance(Object obj) {
72 public void setType(Datatype type) {
77 public boolean isImmutable() {