01: // StringArrayAttribute.java
02: // $Id: StringArrayAttribute.java,v 1.7 2002/06/09 11:31:16 ylafon Exp $
03: // (c) COPYRIGHT MIT and INRIA, 1996.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.tools.resources;
07:
08: /**
09: * The generic description of an StringArrayAttribute.
10: */
11:
12: public class StringArrayAttribute extends ArrayAttribute {
13:
14: /**
15: * Is the given object a valid StringArrayAttribute value ?
16: * @param obj The object to test.
17: * @return A boolean <strong>true</strong> if okay.
18: */
19:
20: public boolean checkValue(Object obj) {
21: if (obj != null) {
22: return (obj instanceof String[]);
23: }
24: return true;
25: }
26:
27: public String[] pickle(Object array) {
28: return (String[]) array;
29: }
30:
31: public Object unpickle(String array[]) {
32: if (array.length < 1)
33: return null;
34: return array;
35: }
36:
37: public StringArrayAttribute(String name, String def[], int flags) {
38: super (name, def, flags);
39: this .type = "[Ljava.lang.String;".intern();
40: }
41:
42: public StringArrayAttribute() {
43: super ();
44: this .type = "[Ljava.lang.String;".intern();
45: }
46:
47: }
|