001    /*******************************************************************************
002     * Portions created by Sebastian Thomschke are copyright (c) 2005-2011 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     *******************************************************************************/
013    package net.sf.oval.constraint;
014    
015    import net.sf.oval.Validator;
016    import net.sf.oval.configuration.annotation.AbstractAnnotationCheck;
017    import net.sf.oval.context.OValContext;
018    
019    /**
020     * @author Sebastian Thomschke
021     */
022    public class AssertConstraintSetCheck extends AbstractAnnotationCheck<AssertConstraintSet>
023    {
024            private static final long serialVersionUID = 1L;
025    
026            private String id;
027    
028            /**
029             * {@inheritDoc}
030             */
031            @Override
032            public void configure(final AssertConstraintSet constraintAnnotation)
033            {
034                    super.configure(constraintAnnotation);
035                    setId(constraintAnnotation.id());
036            }
037    
038            /**
039             * {@inheritDoc}
040             */
041            @Override
042            public String getErrorCode() throws UnsupportedOperationException
043            {
044                    throw new UnsupportedOperationException();
045            }
046    
047            public String getId()
048            {
049                    return id;
050            }
051    
052            /**
053             * {@inheritDoc}
054             */
055            @Override
056            public String getMessage() throws UnsupportedOperationException
057            {
058                    throw new UnsupportedOperationException();
059            }
060    
061            /**
062             * {@inheritDoc}
063             */
064            @Override
065            public int getSeverity() throws UnsupportedOperationException
066            {
067                    throw new UnsupportedOperationException();
068            }
069    
070            /**
071             *  <b>This method is not used.</b><br>
072             *  The validation of this special constraint is directly performed by the Validator class
073             *  @throws UnsupportedOperationException always thrown if this method is invoked
074             */
075            public boolean isSatisfied(final Object validatedObject, final Object valueToValidate, final OValContext context,
076                            final Validator validator) throws UnsupportedOperationException
077            {
078                    throw new UnsupportedOperationException();
079            }
080    
081            /**
082             * {@inheritDoc}
083             */
084            @Override
085            public void setErrorCode(final String errorCode) throws UnsupportedOperationException
086            {
087                    throw new UnsupportedOperationException();
088            }
089    
090            public void setId(final String id)
091            {
092                    this.id = id;
093            }
094    
095            /**
096             * {@inheritDoc}
097             */
098            @Override
099            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    }