001: /*******************************************************************************
002: * Portions created by Sebastian Thomschke are copyright (c) 2005-2007 Sebastian
003: * Thomschke.
004: *
005: * All Rights Reserved. This program and the accompanying materials
006: * are made available under the terms of the Eclipse Public License v1.0
007: * which accompanies this distribution, and is available at
008: * http://www.eclipse.org/legal/epl-v10.html
009: *
010: * Contributors:
011: * Sebastian Thomschke - initial implementation.
012: *******************************************************************************/package net.sf.oval.guard;
013:
014: /**
015: * @author Sebastian Thomschke
016: */
017: public class PostCheck {
018: private static final long serialVersionUID = 1L;
019:
020: private String expression;
021: private String errorCode;
022: private int severity;
023: private String message;
024: private String language;
025: private String old;
026: private String[] profiles;
027:
028: public void configure(final Post constraintAnnotation) {
029: setMessage(constraintAnnotation.message());
030: setErrorCode(constraintAnnotation.errorCode());
031: setSeverity(constraintAnnotation.severity());
032: setExpression(constraintAnnotation.expr());
033: setLanguage(constraintAnnotation.lang());
034: setOld(constraintAnnotation.old());
035: setProfiles(constraintAnnotation.profiles());
036: }
037:
038: /**
039: * @return the failureCode
040: */
041: public String getErrorCode() {
042: return errorCode;
043: }
044:
045: /**
046: * @return the condition
047: */
048: public String getExpression() {
049: return expression;
050: }
051:
052: /**
053: * @return the language
054: */
055: public String getLanguage() {
056: return language;
057: }
058:
059: /**
060: * @return the message
061: */
062: public String getMessage() {
063: return message;
064: }
065:
066: /**
067: * @return the old
068: */
069: public String getOld() {
070: return old;
071: }
072:
073: /**
074: * @return the profiles
075: */
076: public String[] getProfiles() {
077: return profiles;
078: }
079:
080: /**
081: * @return the severity
082: */
083: public int getSeverity() {
084: return severity;
085: }
086:
087: /**
088: * @param failureCode the failureCode to set
089: */
090: public void setErrorCode(final String failureCode) {
091: errorCode = failureCode;
092: }
093:
094: /**
095: * @param condition the condition to set
096: */
097: public void setExpression(final String condition) {
098: expression = condition;
099: }
100:
101: /**
102: * @param language the language to set
103: */
104: public void setLanguage(final String language) {
105: this .language = language;
106: }
107:
108: /**
109: * @param message the message to set
110: */
111: public void setMessage(final String message) {
112: this .message = message;
113: }
114:
115: /**
116: * @param old the old to set
117: */
118: public void setOld(final String old) {
119: this .old = old;
120: }
121:
122: /**
123: * @param profiles the profiles to set
124: */
125: public void setProfiles(final String[] profiles) {
126: this .profiles = profiles;
127: }
128:
129: /**
130: * @param severity the severity to set
131: */
132: public void setSeverity(final int severity) {
133: this.severity = severity;
134: }
135: }
|