|
|||||||||||||||||||
This license of Clover is provided to support the development of JBind only. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover. | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
LengthFacet.java | - | 100% | 100% | 100% |
|
1 |
/* |
|
2 |
* JBind |
|
3 |
* |
|
4 |
* Copyright (c) by Stefan Wachter. All rights reserved. |
|
5 |
* |
|
6 |
* Usage, modification, and redistribution is subject to license terms that are |
|
7 |
* available at 'http://www.jbind.org'. The JBind license is like the |
|
8 |
* 'Apache Software License V 1.1'. |
|
9 |
*/ |
|
10 |
package org.jbind.xml.schema.element; |
|
11 |
|
|
12 |
import org.jbind.xml.core.constraint.ConstraintType; |
|
13 |
import org.jbind.xml.core.constraint.IConstraints; |
|
14 |
import org.jbind.xml.core.type.IAnyType; |
|
15 |
import org.jbind.xml.msg.IConstraintViolations; |
|
16 |
import org.jbind.xml.msg.XmlException; |
|
17 |
|
|
18 |
public class LengthFacet extends Facet { |
|
19 | 44 |
public LengthFacet(CreationParams aCreationParams, ConstraintType.Length aConstraintType) { |
20 | 44 |
super(aCreationParams, aConstraintType); |
21 |
} |
|
22 |
|
|
23 | 33 |
public void doAddConstraint(IAnyType aType, IConstraints aConstraints, IConstraintViolations aViolations) throws XmlException { |
24 | 33 |
int length = getIntValue(); |
25 | 33 |
aConstraints.add(((ConstraintType.Length)getConstraintType()).createConstraint(length), aViolations, this); |
26 |
} |
|
27 |
|
|
28 |
} |
|
29 |
|
|