1   package org.daisy.pipeline.css.impl;
2   
3   import cz.vutbr.web.css.Term;
4   
5   public abstract class UnmodifiableTerm<T> implements Term<T> {
6   
7   	@Override
8   	public T getValue() {
9   		throw new UnsupportedOperationException("not implemented");
10  	}
11  
12  	@Override
13  	public Operator getOperator() {
14  		return null;
15  	}
16  
17  	@SuppressWarnings("unchecked")
18  	@Override
19  	public UnmodifiableTerm<T> shallowClone() {
20  		try {
21  			return (UnmodifiableTerm<T>)super.clone();
22  		} catch (CloneNotSupportedException e) {
23  			throw new InternalError("coding error");
24  		}
25  	}
26  
27  	@Override
28  	public UnmodifiableTerm<T> clone() {
29  		return shallowClone();
30  	}
31  
32  	@Override
33  	public UnmodifiableTerm<T> setValue(T value) {
34  		throw new UnsupportedOperationException("Unmodifiable");
35  	}
36  
37  	@Override
38  	public UnmodifiableTerm<T> setOperator(Operator operator) {
39  		throw new UnsupportedOperationException("Unmodifiable");
40  	}
41  }