001: /*
002: * $Header: /cvsroot/jvalidate/jvalidate-framework/jvalidate/src/main/java/nl/knowlogy/validation/Message.java,v 1.4 2007/06/25 21:28:32 roberthofstra Exp $
003: * $Revision: 1.4 $
004: * $Date: 2007/06/25 21:28:32 $
005: *
006: *
007: * Copyright 2004 - 2005 Knowlogy, the Netherlands, www.knowlogy.nl
008: *
009: * Licensed under the Apache License, Version 2.0 (the "License");
010: * you may not use this file except in compliance with the License.
011: * You may obtain a copy of the License at
012: *
013: * http://www.apache.org/licenses/LICENSE-2.0
014: *
015: * Unless required by applicable law or agreed to in writing, software
016: * distributed under the License is distributed on an "AS IS" BASIS,
017: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018: * See the License for the specific language governing permissions and
019: * limitations under the License.
020: */
021: package nl.knowlogy.validation;
022:
023: /**
024: * <p>
025: * A <code>Message</code> is container which contains data of one specific message.
026: * It contains data like message, messagecode, messagetype, related object and propertyname.
027: * </p>
028: *
029: * @author <a href="mailto:robert.hofstra@knowlogy.nl">Robert Hofstra, Knowlogy</a>
030: *
031: */
032: public interface Message {
033:
034: /**
035: * <p>
036: * Returns the name of the property to which the message is related. Null
037: * is returned if the message is not related to a specific property.
038: * </p>
039: * @return The name of the property which contains a message.
040: * null if the message is not related to any property
041: */
042: String getPropertyName();
043:
044: /**
045: * <p>
046: * Returns the messagecode for the message.
047: * </p>
048: * @return the messagecode.
049: */
050: String getMessageCode();
051:
052: /**
053: * <p>
054: * Returns the message.
055: * </p>
056: * @return the messssageMessage.
057: */
058: String getMessage();
059:
060: void setMessage(String message);
061:
062: /**
063: * <p>
064: * Returns the string representation.
065: * </p>
066: * @return the string representation.
067: */
068: String toString();
069:
070: /**
071: * <p>
072: * Returns the messssage Arguments which contain information about the
073: * occured event. Which arguments are returned can depend on the messagecode.
074: * </p>
075: *
076: * @return
077: * Returns the messssage Arguments which contain information about the
078: * occured event. Which arguments are returned can depend on the messagecode.
079: */
080: Object[] getMessageArgs();
081:
082: //String[] getValidationGroups();
083:
084: /**
085: * <p>
086: * Returns the object to which the message is related.
087: * </p>
088: *
089: * @return object to which the message is related.
090: */
091: Object getRelatedObject();
092:
093: /**
094: * <p>
095: * Returns type of the message.
096: * </p>
097: *
098: * @see MessageType
099: *
100: * @return type of the message
101: */
102: MessageType getMessageType();
103:
104: boolean isRendered();
105:
106: void setRendered(boolean rendered);
107:
108: }
|