本文整理汇总了Java中org.relaxng.datatype.DatatypeLibraryFactory类的典型用法代码示例。如果您正苦于以下问题:Java DatatypeLibraryFactory类的具体用法?Java DatatypeLibraryFactory怎么用?Java DatatypeLibraryFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DatatypeLibraryFactory类属于org.relaxng.datatype包,在下文中一共展示了DatatypeLibraryFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import org.relaxng.datatype.DatatypeLibraryFactory; //导入依赖的package包/类
public MatchablePattern load(Input input,
SAXResolver saxResolver,
ErrorHandler eh,
DatatypeLibraryFactory dlf,
int flags) throws IOException, SAXException, IncorrectSchemaException {
SchemaPatternBuilder spb = new SchemaPatternBuilder();
Parseable<Pattern, com.thaiopensource.relaxng.pattern.NameClass, Locator, VoidValue, CommentListImpl, AnnotationsImpl> parseable;
if ((flags & COMPACT_SYNTAX_FLAG) != 0)
parseable = new CompactParseable<Pattern, NameClass, Locator, VoidValue, CommentListImpl, AnnotationsImpl>(input, saxResolver.getResolver(), eh);
else
parseable = new SAXParseable<Pattern, NameClass, Locator, VoidValue, CommentListImpl, AnnotationsImpl>(saxResolver.createSAXSource(input), saxResolver, eh);
if (dlf == null)
dlf = new DatatypeLibraryLoader();
try {
Pattern start = SchemaBuilderImpl.parse(parseable, eh, dlf, spb, false);
if ((flags & FEASIBLE_FLAG) != 0)
start = FeasibleTransform.transform(spb, start);
return new MatchablePatternImpl(spb, start);
}
catch (IllegalSchemaException e) {
throw new IncorrectSchemaException();
}
}
示例2: parse
import org.relaxng.datatype.DatatypeLibraryFactory; //导入依赖的package包/类
static public Pattern parse(Parseable<Pattern, NameClass, Locator, VoidValue, CommentListImpl, AnnotationsImpl> parseable,
ErrorHandler eh,
DatatypeLibraryFactory datatypeLibraryFactory,
SchemaPatternBuilder pb,
boolean isAttributesPattern)
throws IllegalSchemaException, IOException, SAXException {
try {
SchemaBuilderImpl sb = new SchemaBuilderImpl(parseable,
eh,
new BuiltinDatatypeLibraryFactory(datatypeLibraryFactory),
pb);
Pattern pattern = parseable.parse(sb, new RootScope(sb));
if (isAttributesPattern)
pattern = sb.wrapAttributesPattern(pattern);
return sb.expandPattern(pattern);
}
catch (BuildException e) {
throw unwrapBuildException(e);
}
}
示例3: installHandlers
import org.relaxng.datatype.DatatypeLibraryFactory; //导入依赖的package包/类
static public PatternFuture installHandlers(ParseReceiver<Pattern, NameClass, Locator, VoidValue, CommentListImpl, AnnotationsImpl> parser,
XMLReader xr,
ErrorHandler eh,
DatatypeLibraryFactory dlf,
SchemaPatternBuilder pb)
throws SAXException {
final SchemaBuilderImpl sb = new SchemaBuilderImpl(parser,
eh,
new BuiltinDatatypeLibraryFactory(dlf),
pb);
final ParsedPatternFuture<Pattern> pf = parser.installHandlers(xr, sb, new RootScope(sb));
return new PatternFuture() {
public Pattern getPattern(boolean isAttributesPattern) throws IllegalSchemaException, SAXException, IOException {
try {
Pattern pattern = pf.getParsedPattern();
if (isAttributesPattern)
pattern = sb.wrapAttributesPattern(pattern);
return sb.expandPattern(pattern);
}
catch (BuildException e) {
throw unwrapBuildException(e);
}
}
};
}
示例4: parse
import org.relaxng.datatype.DatatypeLibraryFactory; //导入依赖的package包/类
static SchemaCollection parse(Parseable<Pattern, NameClass, SourceLocation, ElementAnnotationBuilderImpl, CommentListImpl, AnnotationsImpl> parseable,
String uri, ErrorHandler eh, DatatypeLibraryFactory dlf, boolean commentsNeedTrimming)
throws IllegalSchemaException, IOException, SAXException {
try {
SchemaCollection sc = new SchemaCollection();
SchemaBuilderImpl sb = new SchemaBuilderImpl(parseable, eh, sc.getSchemaDocumentMap(), dlf, commentsNeedTrimming);
sc.setMainUri(uri);
sb.parse(parseable, uri);
if (sb.hadError)
throw new IllegalSchemaException();
return sc;
}
catch (BuildException e) {
Throwable t = e.getCause();
if (t instanceof IOException)
throw (IOException)t;
if (t instanceof RuntimeException)
throw (RuntimeException)t;
if (t instanceof SAXException)
throw (SAXException)t;
if (t instanceof Exception)
throw new SAXException((Exception)t);
throw new SAXException(t.getClass().getName() + " thrown");
}
}
示例5: createSchema
import org.relaxng.datatype.DatatypeLibraryFactory; //导入依赖的package包/类
public Schema createSchema(SAXSource source, PropertyMap properties)
throws IOException, SAXException, IncorrectSchemaException {
SchemaPatternBuilder spb = new SchemaPatternBuilder();
SAXResolver resolver = ResolverFactory.createResolver(properties);
ErrorHandler eh = properties.get(ValidateProperty.ERROR_HANDLER);
DatatypeLibraryFactory dlf = properties.get(RngProperty.DATATYPE_LIBRARY_FACTORY);
if (dlf == null)
dlf = new DatatypeLibraryLoader();
try {
Pattern start = SchemaBuilderImpl.parse(createParseable(source, resolver, eh, properties), eh, dlf, spb,
properties.contains(WrapProperty.ATTRIBUTE_OWNER));
return wrapPattern(start, spb, properties);
}
catch (IllegalSchemaException e) {
throw new IncorrectSchemaException();
}
}
示例6: createDatatypeLibrary
import org.relaxng.datatype.DatatypeLibraryFactory; //导入依赖的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;
}
示例7: SchemaBuilderImpl
import org.relaxng.datatype.DatatypeLibraryFactory; //导入依赖的package包/类
/**
*
* @param eh Error handler to receive errors while building the schema.
* @param datatypeLibraryFactory This is consulted to locate datatype
* libraries.
* @param pb Used to build patterns.
*/
public SchemaBuilderImpl(ErrorHandler eh,
DatatypeLibraryFactory datatypeLibraryFactory,
SchemaPatternBuilder pb) {
this.parent = null;
this.eh = eh;
this.datatypeLibraryFactory = datatypeLibraryFactory;
this.pb = pb;
this.inheritNs = "";
this.openIncludes = null;
}
示例8: createDatatypeLibrary
import org.relaxng.datatype.DatatypeLibraryFactory; //导入依赖的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;
}
示例9: compute
import org.relaxng.datatype.DatatypeLibraryFactory; //导入依赖的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);
}
});
}
示例10: createXsdDatatypeFactory
import org.relaxng.datatype.DatatypeLibraryFactory; //导入依赖的package包/类
private static DatatypeLibraryFactory createXsdDatatypeFactory() {
try {
return new DatatypeLibraryFactoryImpl();
} catch (Throwable e) {
LOG.error("Could not create DT library implementation 'com.thaiopensource.datatype.xsd.DatatypeLibraryFactoryImpl'. Plugin's classpath seems to be broken.", e);
return new DoNothingDatatypeLibraryFactoryImpl();
}
}
示例11: DatatypeRepertoire
import org.relaxng.datatype.DatatypeLibraryFactory; //导入依赖的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) {
}
}
}
示例12: SchemaBuilderImpl
import org.relaxng.datatype.DatatypeLibraryFactory; //导入依赖的package包/类
private SchemaBuilderImpl(SubParser<Pattern, NameClass, Locator, VoidValue, CommentListImpl, AnnotationsImpl> subParser,
ErrorHandler eh,
DatatypeLibraryFactory datatypeLibraryFactory,
SchemaPatternBuilder pb) {
this.parent = null;
this.subParser = subParser;
this.eh = eh;
this.datatypeLibraryFactory = datatypeLibraryFactory;
this.pb = pb;
this.inheritNs = "";
this.openIncludes = null;
}
示例13: createDatatypeLibrary
import org.relaxng.datatype.DatatypeLibraryFactory; //导入依赖的package包/类
public DatatypeLibrary createDatatypeLibrary(String uri) {
for (Iterator<DatatypeLibraryFactory> iter = service.getProviders(); iter.hasNext();) {
DatatypeLibraryFactory factory = iter.next();
DatatypeLibrary library = factory.createDatatypeLibrary(uri);
if (library != null)
return library;
}
return null;
}
示例14: SchemaBuilderImpl
import org.relaxng.datatype.DatatypeLibraryFactory; //导入依赖的package包/类
private SchemaBuilderImpl(SubParser<Pattern, NameClass, SourceLocation, ElementAnnotationBuilderImpl, CommentListImpl, AnnotationsImpl> subParser,
ErrorHandler eh, Map<String, SchemaDocument> schemas,
DatatypeLibraryFactory dlf,
boolean commentsNeedTrimming) {
this.subParser = subParser;
this.eh = eh;
this.schemas = schemas;
this.dlf = dlf;
this.commentsNeedTrimming = commentsNeedTrimming;
}
示例15: setProperty
import org.relaxng.datatype.DatatypeLibraryFactory; //导入依赖的package包/类
public void setProperty(String name, Object object) throws SAXNotRecognizedException, SAXNotSupportedException {
if (PROPERTY_DATATYPE_LIBRARY_FACTORY.equals(name)) {
if (object instanceof DatatypeLibraryFactory) {
datatypeLibraryFactory = (DatatypeLibraryFactory)object;
defaultDatatypeLibraryFactory = false;
}
else
throw new SAXNotSupportedException("value of \"" + PROPERTY_DATATYPE_LIBRARY_FACTORY +
"\" property does not implement org.relaxng.datatype.DatatypeLibraryFactory");
}
else
super.setProperty(name, object);
}