01: /*
02: * Copyright (c) 2002-2006 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.xwork.config.entities;
06:
07: import java.io.Serializable;
08:
09: /**
10: * Encapsulates an external reference in the xwork configuration.
11: *
12: * @author Ross
13: * @author Rainer Hermanns
14: */
15: public class ExternalReference implements Serializable {
16:
17: private String externalRef;
18: private String name;
19: private boolean required = true;
20:
21: /**
22: * default constructor
23: */
24: public ExternalReference() {
25: }
26:
27: /**
28: * @param name the name of the attribute the external reference refers to
29: * @param externalRef the name used to query the external source
30: * @param required determines whether an exception should be thrown if the reference is not resolved
31: */
32: public ExternalReference(String name, String externalRef,
33: boolean required) {
34: this .name = name;
35: this .externalRef = externalRef;
36: this .required = required;
37: }
38:
39: /**
40: * @param externalRef The externalRef to set.
41: */
42: public void setExternalRef(String externalRef) {
43: this .externalRef = externalRef;
44: }
45:
46: /**
47: * @return Returns the externalRef.
48: */
49: public String getExternalRef() {
50: return externalRef;
51: }
52:
53: /**
54: * @param name The name to set.
55: */
56: public void setName(String name) {
57: this .name = name;
58: }
59:
60: /**
61: * @return Returns the name.
62: */
63: public String getName() {
64: return name;
65: }
66:
67: /**
68: * @param required The required to set.
69: */
70: public void setRequired(boolean required) {
71: this .required = required;
72: }
73:
74: /**
75: * @return Returns the required.
76: */
77: public boolean isRequired() {
78: return required;
79: }
80: }
|