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.cmp;
|
11
|
|
|
12
|
|
import java.util.Collections;
|
13
|
|
|
14
|
|
import org.jbind.xml.base.INamespaces;
|
15
|
|
import org.jbind.xml.core.cmp.ISourceInfo;
|
16
|
|
import org.jbind.xml.core.constraint.ConstraintType;
|
17
|
|
import org.jbind.xml.core.constraint.ConstraintType.Checker;
|
18
|
|
import org.jbind.xml.core.constraint.ICheckContext;
|
19
|
|
import org.jbind.xml.core.data.IDataCreator;
|
20
|
|
import org.jbind.xml.core.type.IAnySimpleType;
|
21
|
|
import org.jbind.xml.core.type.IAnyType;
|
22
|
|
import org.jbind.xml.schema.constraint.Constraints;
|
23
|
|
|
24
|
|
public abstract class BuiltInSimpleType extends SimpleType implements IAnySimpleType {
|
25
|
|
|
26
|
|
private Checker myChecker = null;
|
27
|
|
|
28
|
126
|
public BuiltInSimpleType(ISourceInfo aSourceInfo, String aName, IAnyType aBaseType, Checker aChecker, IDataCreator aDataCreator) {
|
29
|
126
|
super(aSourceInfo, INamespaces.XML_SCHEMA, aName, null, Collections.EMPTY_SET);
|
30
|
126
|
myChecker = aChecker;
|
31
|
126
|
setConstraints(new Constraints());
|
32
|
126
|
setBaseType(aBaseType);
|
33
|
126
|
setDataCreator(aDataCreator);
|
34
|
|
}
|
35
|
|
|
36
|
300
|
public final boolean isApplicable(ConstraintType aConstraintType) {
|
37
|
300
|
return myChecker.isApplicable(aConstraintType);
|
38
|
|
}
|
39
|
|
|
40
|
1139
|
public void checkEnclosedConstraints(ICheckContext aContext) {}
|
41
|
|
|
42
|
490
|
public IAnyType getInstanceType() {
|
43
|
490
|
return this;
|
44
|
|
}
|
45
|
|
|
46
|
749
|
public boolean isUnion() {
|
47
|
749
|
return false;
|
48
|
|
}
|
49
|
|
}
|
50
|
|
|