Skip to main content
summaryrefslogtreecommitdiffstats
blob: 1b1b96020177c0515a217ee31de296834898386e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Copyright (c) 2008 Arno Haase.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html

Contributors:
    Arno Haase - initial API and implementation
 */
package org.eclipse.xtend.backend.types;

import org.eclipse.xtend.backend.common.BackendType;
import org.eclipse.xtend.backend.common.ExecutionContext;
import org.eclipse.xtend.backend.common.Property;


/**
 * 
 * @author Arno Haase (http://www.haase-consulting.com)
 */
public abstract class AbstractProperty implements Property {
    protected final BackendType _owner;
    protected final BackendType _type;
    protected final String _name;
    
    public AbstractProperty (BackendType owner, BackendType type, String name) {
        _owner = owner;
        _type = type;
        _name = name;
    }

    public String getName () {
        return _name;
    }
    
    public BackendType getOwner () {
        return _owner;
    }
    
    public BackendType getType () {
        return _type;
    }
    
    public Object get (ExecutionContext ctx, Object o) {
        throw new IllegalStateException ("property " + _name + " of type " + _owner.getName() + " can not be read");
    }

    public void set (ExecutionContext ctx, Object o, Object newValue) {
        throw new IllegalStateException ("property " + _name + " of type " + _owner.getName() + " can not be set");
    }
}

Back to the top