View Javadoc
1   /*******************************************************************************
2    * Portions created by Sebastian Thomschke are copyright (c) 2005-2011 Sebastian
3    * Thomschke.
4    * 
5    * All Rights Reserved. This program and the accompanying materials
6    * are made available under the terms of the Eclipse Public License v1.0
7    * which accompanies this distribution, and is available at
8    * http://www.eclipse.org/legal/epl-v10.html
9    * 
10   * Contributors:
11   *     Sebastian Thomschke - initial implementation.
12   *******************************************************************************/
13  package net.sf.oval.constraint;
14  
15  import net.sf.oval.Validator;
16  import net.sf.oval.configuration.annotation.AbstractAnnotationCheck;
17  import net.sf.oval.context.OValContext;
18  
19  /**
20   * @author Sebastian Thomschke
21   */
22  public class AssertConstraintSetCheck extends AbstractAnnotationCheck<AssertConstraintSet>
23  {
24  	private static final long serialVersionUID = 1L;
25  
26  	private String id;
27  
28  	/**
29  	 * {@inheritDoc}
30  	 */
31  	@Override
32  	public void configure(final AssertConstraintSet constraintAnnotation)
33  	{
34  		super.configure(constraintAnnotation);
35  		setId(constraintAnnotation.id());
36  	}
37  
38  	/**
39  	 * {@inheritDoc}
40  	 */
41  	@Override
42  	public String getErrorCode() throws UnsupportedOperationException
43  	{
44  		throw new UnsupportedOperationException();
45  	}
46  
47  	public String getId()
48  	{
49  		return id;
50  	}
51  
52  	/**
53  	 * {@inheritDoc}
54  	 */
55  	@Override
56  	public String getMessage() throws UnsupportedOperationException
57  	{
58  		throw new UnsupportedOperationException();
59  	}
60  
61  	/**
62  	 * {@inheritDoc}
63  	 */
64  	@Override
65  	public int getSeverity() throws UnsupportedOperationException
66  	{
67  		throw new UnsupportedOperationException();
68  	}
69  
70  	/**
71  	 *  <b>This method is not used.</b><br>
72  	 *  The validation of this special constraint is directly performed by the Validator class
73  	 *  @throws UnsupportedOperationException always thrown if this method is invoked
74  	 */
75  	public boolean isSatisfied(final Object validatedObject, final Object valueToValidate, final OValContext context,
76  			final Validator validator) throws UnsupportedOperationException
77  	{
78  		throw new UnsupportedOperationException();
79  	}
80  
81  	/**
82  	 * {@inheritDoc}
83  	 */
84  	@Override
85  	public void setErrorCode(final String errorCode) throws UnsupportedOperationException
86  	{
87  		throw new UnsupportedOperationException();
88  	}
89  
90  	public void setId(final String id)
91  	{
92  		this.id = id;
93  	}
94  
95  	/**
96  	 * {@inheritDoc}
97  	 */
98  	@Override
99  	public void setMessage(final String message) throws UnsupportedOperationException
100 	{
101 		throw new UnsupportedOperationException();
102 	}
103 
104 	/**
105 	 * {@inheritDoc}
106 	 */
107 	@Override
108 	public void setSeverity(final int severity) throws UnsupportedOperationException
109 	{
110 		throw new UnsupportedOperationException();
111 	}
112 }