|
|||||||||||||||||||
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 | |||||||||||||||
SimpleContentModelDesc.java | 75% | 83,3% | 60% | 76,2% |
|
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.msg.XmlException; |
|
13 |
|
|
14 |
public class SimpleContentModelDesc extends ContentModelDesc implements ISimpleContentModelDesc { |
|
15 |
|
|
16 |
private String myRole = null; |
|
17 |
|
|
18 | 35 |
public SimpleContentModelDesc(CreationParams aCreationParams, String aRole) { |
19 | 35 |
super(aCreationParams); |
20 | 35 |
myRole = aRole; |
21 |
} |
|
22 |
|
|
23 | 35 |
public IElement doCreateChild(CreationParams aCreationParams) throws XmlException { |
24 | 35 |
IElement res = null; |
25 | 35 |
String componentName = NameUtil.getSchemaComponentName(aCreationParams); |
26 | 35 |
if ("extension".equals(componentName)) { |
27 | 23 |
res = new SimpleExtensionDerivation(aCreationParams); |
28 | 12 |
} else if ("restriction".equals(componentName)) { |
29 | 12 |
res = new SimpleRestrictionDerivation(aCreationParams, myRole); |
30 |
} else { |
|
31 | 0 |
res = super.doCreateChild(aCreationParams); |
32 |
} |
|
33 | 35 |
return res; |
34 |
} |
|
35 |
|
|
36 | 290 |
public boolean isComplex() { |
37 | 290 |
return false; |
38 |
} |
|
39 |
|
|
40 | 0 |
public Boolean isMixed() { |
41 | 0 |
return null; |
42 |
} |
|
43 |
|
|
44 |
|
|
45 | 0 |
public void setIsMixed(boolean aBoolean) { |
46 |
assert !aBoolean : "simple content model can not be mixed"; |
|
47 |
} |
|
48 |
} |
|
49 |
|
|