本文整理汇总了Java中org.relaxng.datatype.DatatypeLibrary类的典型用法代码示例。如果您正苦于以下问题:Java DatatypeLibrary类的具体用法?Java DatatypeLibrary怎么用?Java DatatypeLibrary使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DatatypeLibrary类属于org.relaxng.datatype包,在下文中一共展示了DatatypeLibrary类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeDataPatternBuilder
import org.relaxng.datatype.DatatypeLibrary; //导入依赖的package包/类
public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, Location loc)
throws BuildException {
DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary);
if (dl == null) {
error("unrecognized_datatype_library", datatypeLibrary, (Locator) loc);
} else {
try {
return new DataPatternBuilderImpl(dl.createDatatypeBuilder(type));
} catch (DatatypeException e) {
String detail = e.getMessage();
if (detail != null) {
error("unsupported_datatype_detail", datatypeLibrary, type, detail, (Locator) loc);
} else {
error("unrecognized_datatype", datatypeLibrary, type, (Locator) loc);
}
}
}
return new DummyDataPatternBuilder();
}
示例2: parseValue
import org.relaxng.datatype.DatatypeLibrary; //导入依赖的package包/类
ValuePattern parseValue(Element node)
throws GrammarException
{
checkName(node, "value");
ValuePattern value = new ValuePattern();
DatatypeLibrary dl =
getDatatypeLibrary(node.getAttribute("datatypeLibrary"));
String type = node.getAttribute("type");
try
{
value.type = dl.createDatatype(type);
value.datatypeLibrary = dl;
}
catch (DatatypeException e)
{
GrammarException e2 = new GrammarException(type);
e2.initCause(e);
throw e2;
}
value.ns = node.getAttribute("ns");
value.value = node.getTextContent();
return value;
}
示例3: createDatatypeLibrary
import org.relaxng.datatype.DatatypeLibrary; //导入依赖的package包/类
public DatatypeLibrary createDatatypeLibrary(String uri) {
if (uri.equals(""))
return builtinDatatypeLibrary;
if (uri.equals(lastDatatypeLibraryUri))
return lastDatatypeLibrary;
DatatypeLibrary library = cache.get(uri);
if (library == null) {
if (factory == null)
return null;
library = factory.createDatatypeLibrary(uri);
if (library == null)
return null;
cache.put(uri, library);
}
lastDatatypeLibraryUri = uri;
return lastDatatypeLibrary = library;
}
示例4: makeDataPatternBuilder
import org.relaxng.datatype.DatatypeLibrary; //导入依赖的package包/类
public DataPatternBuilder<Pattern, Locator, VoidValue, CommentListImpl, AnnotationsImpl> makeDataPatternBuilder(String datatypeLibrary, String type, Locator loc)
throws BuildException {
DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary);
if (dl == null)
error("unrecognized_datatype_library", datatypeLibrary, loc);
else {
try {
return new DataPatternBuilderImpl(dl.createDatatypeBuilder(type), new Name(datatypeLibrary, type));
}
catch (DatatypeException e) {
String detail = e.getMessage();
if (detail != null)
error("unsupported_datatype_detail", datatypeLibrary, type, detail, loc);
else
error("unrecognized_datatype", datatypeLibrary, type, loc);
}
}
return new DummyDataPatternBuilder();
}
示例5: DataPatternBuilderImpl
import org.relaxng.datatype.DatatypeLibrary; //导入依赖的package包/类
DataPatternBuilderImpl(DataPattern p) throws BuildException {
this.p = p;
DatatypeLibrary dl = dlf.createDatatypeLibrary(p.getDatatypeLibrary());
if (dl != null) {
try {
dtb = dl.createDatatypeBuilder(p.getType());
}
catch (DatatypeException e) {
String datatypeLibrary = p.getDatatypeLibrary();
String type = p.getType();
SourceLocation loc = p.getSourceLocation();
String detail = e.getMessage();
if (detail != null)
error("unsupported_datatype_detail", datatypeLibrary, type, detail, loc);
else
error("unknown_datatype", datatypeLibrary, type, loc);
}
}
}
示例6: makeDataPatternBuilder
import org.relaxng.datatype.DatatypeLibrary; //导入依赖的package包/类
public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, Location loc)
throws BuildException {
DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary);
if (dl == null)
error("unrecognized_datatype_library", datatypeLibrary, (Locator)loc);
else {
try {
return new DataPatternBuilderImpl(dl.createDatatypeBuilder(type));
}
catch (DatatypeException e) {
String detail = e.getMessage();
if (detail != null)
error("unsupported_datatype_detail", datatypeLibrary, type, detail, (Locator)loc);
else
error("unrecognized_datatype", datatypeLibrary, type, (Locator)loc);
}
}
return new DummyDataPatternBuilder();
}
示例7: createDatatypeLibrary
import org.relaxng.datatype.DatatypeLibrary; //导入依赖的package包/类
public DatatypeLibrary createDatatypeLibrary(String uri) {
for (Enumeration e = service.getProviders();
e.hasMoreElements();) {
DatatypeLibraryFactory factory
= (DatatypeLibraryFactory)e.nextElement();
DatatypeLibrary library = factory.createDatatypeLibrary(uri);
if (library != null)
return library;
}
return null;
}
示例8: createDatatypeLibrary
import org.relaxng.datatype.DatatypeLibrary; //导入依赖的package包/类
public DatatypeLibrary createDatatypeLibrary(String namespaceURI) {
if( lastUri==namespaceURI )
return lastLib;
lastUri = namespaceURI;
lastLib = core.createDatatypeLibrary(namespaceURI);
return lastLib;
}
示例9: createDatatypeLibrary
import org.relaxng.datatype.DatatypeLibrary; //导入依赖的package包/类
public DatatypeLibrary createDatatypeLibrary(String uri) {
if (uri.equals(""))
return builtinDatatypeLibrary;
if (uri.equals(WellKnownNamespaces.RELAX_NG_COMPATIBILITY_DATATYPES))
return compatibilityDatatypeLibrary;
return core.createDatatypeLibrary(uri);
}
示例10: createDatatypeLibrary
import org.relaxng.datatype.DatatypeLibrary; //导入依赖的package包/类
public DatatypeLibrary createDatatypeLibrary(String namespaceURI) {
if( lastUri==namespaceURI )
return lastLib;
lastUri = namespaceURI;
lastLib = core.createDatatypeLibrary(namespaceURI);
return lastLib;
}
示例11: createDatatypeLibrary
import org.relaxng.datatype.DatatypeLibrary; //导入依赖的package包/类
public DatatypeLibrary createDatatypeLibrary(String uri) {
for (Enumeration e = service.getProviders();
e.hasMoreElements();) {
DatatypeLibraryFactory factory
= (DatatypeLibraryFactory)e.nextElement();
DatatypeLibrary library = factory.createDatatypeLibrary(uri);
if (library != null)
return library;
}
return null;
}
示例12: parseData
import org.relaxng.datatype.DatatypeLibrary; //导入依赖的package包/类
DataPattern parseData(Element node)
throws GrammarException
{
checkName(node, "data");
DataPattern data = new DataPattern();
DatatypeLibrary dl =
getDatatypeLibrary(node.getAttribute("datatypeLibrary"));
String type = node.getAttribute("type");
try
{
data.type = dl.createDatatype(type);
data.datatypeLibrary = dl;
}
catch (DatatypeException e)
{
GrammarException e2 = new GrammarException(type);
e2.initCause(e);
throw e2;
}
Element ctx = getFirstChildElement(node);
while (ctx != null)
{
Element next = getNextSiblingElement(ctx);
String name = ctx.getLocalName();
if ("param".equals(name))
data.params.add(parseParam(ctx));
else if ("except".equals(name) && next == null)
data.exceptPattern = parsePattern(getFirstChildElement(ctx));
else
throw new GrammarException("invalid element: " + name);
ctx = next;
}
return data;
}
示例13: getDatatypeLibrary
import org.relaxng.datatype.DatatypeLibrary; //导入依赖的package包/类
DatatypeLibrary getDatatypeLibrary(String uri)
throws GrammarException
{
if (datatypeLibraries == null)
datatypeLibraries = new HashMap();
DatatypeLibrary library = (DatatypeLibrary) datatypeLibraries.get(uri);
if (library == null)
{
library = new DatatypeLibraryLoader().createDatatypeLibrary(uri);
if (library == null)
throw new GrammarException("Datatype library not supported: " + uri);
datatypeLibraries.put(uri, library);
}
return library;
}
示例14: compute
import org.relaxng.datatype.DatatypeLibrary; //导入依赖的package包/类
@NotNull
@Override
protected DatatypeLibraryFactory compute() {
return new BuiltinDatatypeLibraryFactory(new CachedDatatypeLibraryFactory(
new CascadingDatatypeLibraryFactory(createXsdDatatypeFactory(), new DatatypeLibraryLoader())) {
@Override
public synchronized DatatypeLibrary createDatatypeLibrary(String namespaceURI) {
return super.createDatatypeLibrary(namespaceURI);
}
});
}
示例15: DatatypeRepertoire
import org.relaxng.datatype.DatatypeLibrary; //导入依赖的package包/类
DatatypeRepertoire(DatatypeLibraryFactory factory) {
DatatypeLibrary lib = factory.createDatatypeLibrary(WellKnownNamespaces.XML_SCHEMA_DATATYPES);
if (lib == null)
return;
for (int i = 0; i < types.length; i++) {
try {
types[nTypes] = makeType(typeNames[i],
lib.createDatatype(typeNames[i]),
i);
nTypes++;
}
catch (DatatypeException e) {
}
}
}