01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18: package org.apache.lenya.cms.metadata;
19:
20: /**
21: * Element implementation.
22: */
23: public class ElementImpl implements Element {
24:
25: private String name;
26: private boolean multiple;
27: private String description = "";
28: private boolean editable;
29:
30: /**
31: * Ctor.
32: * @param name The name.
33: * @param isMultiple if the element can have multiple values.
34: * @param isEditable if the element can be edited.
35: */
36: public ElementImpl(String name, boolean isMultiple,
37: boolean isEditable) {
38: this .name = name;
39: this .multiple = isMultiple;
40: this .editable = isEditable;
41: }
42:
43: /**
44: * Ctor.
45: * @param name The name.
46: * @param isMultiple if the element can have multiple values.
47: * @param isEditable if the element can be edited.
48: * @param description The description of the element.
49: */
50: public ElementImpl(String name, boolean isMultiple,
51: boolean isEditable, String description) {
52: this (name, isMultiple, isEditable);
53: this .description = description;
54: }
55:
56: public String getName() {
57: return this .name;
58: }
59:
60: public boolean isMultiple() {
61: return this .multiple;
62: }
63:
64: public String getDescription() {
65: return this .description;
66: }
67:
68: public boolean isEditable() {
69: return this .editable;
70: }
71:
72: private int actionOnCopy;
73:
74: public int getActionOnCopy() {
75: return this .actionOnCopy;
76: }
77:
78: /**
79: * @param action The action to be executed when the meta data are copied.
80: * @throws MetaDataException if the action is not supported.
81: */
82: public void setActionOnCopy(int action) throws MetaDataException {
83: this.actionOnCopy = action;
84: }
85:
86: }
|