01: /* $Id: StaticDomainProvider.java 652 2006-01-19 11:12:50Z hengels $ */
02: package org.conform;
03:
04: import java.util.*;
05:
06: /**
07: * @version $Revision: 652 $
08: */
09: public class StaticDomainProvider implements DomainProvider {
10: private Object[] enumerationValues;
11:
12: public StaticDomainProvider() {
13: }
14:
15: public StaticDomainProvider(Object[] enumerationValues) {
16: this .enumerationValues = enumerationValues;
17: }
18:
19: public Object[] getEnumerationValues() {
20: return enumerationValues;
21: }
22:
23: public void setEnumerationValues(Object[] enumerationValues) {
24: this .enumerationValues = enumerationValues;
25: }
26:
27: public List getDomain() {
28: return getEnumerationValues() != null ? Arrays
29: .asList(getEnumerationValues())
30: : Collections.EMPTY_LIST;
31: }
32:
33: public String toString() {
34: return "Enumeration: "
35: + (enumerationValues != null ? ""
36: + enumerationValues.length : "-");
37: }
38: }
|