|
|||||||||||||||||||
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 | |||||||||||||||
RestrictionVariety.java | 50% | 77,8% | 100% | 76,5% |
|
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.base.IRef; |
|
13 |
import org.jbind.xml.msg.IConstraintViolations; |
|
14 |
import org.jbind.xml.msg.XmlMessages; |
|
15 |
import org.jbind.xml.schema.instantiation.IElemValHelper; |
|
16 |
|
|
17 |
public class RestrictionVariety extends SimpleRestriction implements IRestrictionVariety { |
|
18 |
|
|
19 | 230 |
public RestrictionVariety(CreationParams aCreationParams) { |
20 | 230 |
super(aCreationParams); |
21 |
} |
|
22 |
|
|
23 | 230 |
public void validateElement(IElemValHelper aHelper, IConstraintViolations aViolations) { |
24 | 230 |
super.validateElement(aHelper, aViolations); |
25 | 230 |
if ((getBaseAttribute() != null) && (getSimpleTypeDef() != null)) { |
26 | 0 |
aViolations.add(XmlMessages.referencedAndInlinedBaseType(this)); |
27 |
} |
|
28 |
} |
|
29 |
|
|
30 | 190 |
protected boolean referencedBaseTypeMustNotBeComplex() { |
31 | 190 |
return true; |
32 |
} |
|
33 |
|
|
34 | 5 |
public IRef getBaseRef() { |
35 | 5 |
IRef res = getBaseAttribute(); |
36 | 5 |
if (null == res) { |
37 | 0 |
getSimpleTypeDef().getBaseRef(); |
38 |
} |
|
39 | 5 |
return res; |
40 |
} |
|
41 |
|
|
42 |
} |
|
43 |
|
|