|
|||||||||||||||||||
| 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 | |||||||||||||||
| TypeKeyConstraintElement.java | 50% | 100% | 100% | 90,9% |
|
||||||||||||||
| 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.cmp.IComponent; |
|
| 13 |
import org.jbind.xml.msg.IConstraintViolations; |
|
| 14 |
import org.jbind.xml.schema.cmp.W3CTypes; |
|
| 15 |
import org.jbind.xml.schema.constraint.TypeKeyConstraint; |
|
| 16 |
import org.jbind.xml.schema.instantiation.IElementHelper; |
|
| 17 |
|
|
| 18 |
public class TypeKeyConstraintElement extends TypeKeyOrUniqueConstraintElement implements IKeyConstraintElement {
|
|
| 19 |
|
|
| 20 | 4 |
public TypeKeyConstraintElement(CreationParams aCreationParams) {
|
| 21 | 4 |
super(aCreationParams); |
| 22 |
} |
|
| 23 |
|
|
| 24 | 4 |
public IComponent createComponent(IElementHelper anElementHelper, IConstraintViolations aViolations) {
|
| 25 | 4 |
return new TypeKeyConstraint(this, getTargetNamespace(), getName(), getScope()); |
| 26 |
} |
|
| 27 |
|
|
| 28 | 4 |
public void completeComponent(IElementHelper anElementHelper, IComponent aComponent, IConstraintViolations aViolations) {
|
| 29 | 4 |
super.completeComponent(anElementHelper, aComponent, aViolations); |
| 30 | 4 |
TypeKeyConstraint c = (TypeKeyConstraint)aComponent; |
| 31 | 4 |
if (null == c.getDataType()) {
|
| 32 | 4 |
c.setDataType(W3CTypes.anyType); |
| 33 |
} |
|
| 34 |
} |
|
| 35 |
} |
|
| 36 |
|
|
||||||||||