当前位置: 首页>>代码示例>>Java>>正文


Java DatatypeLibraryFactory类代码示例

本文整理汇总了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();
  }
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:24,代码来源:MatchablePatternLoader.java

示例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);
  }
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:21,代码来源:SchemaBuilderImpl.java

示例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);
      }
    }
  };
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:26,代码来源:SchemaBuilderImpl.java

示例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");
  }
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:26,代码来源:SchemaBuilderImpl.java

示例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();
  }
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:18,代码来源:SchemaReaderImpl.java

示例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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:DatatypeLibraryLoader.java

示例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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:SchemaBuilderImpl.java

示例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;
 }
 
开发者ID:vilie,项目名称:javify,代码行数:12,代码来源:DatatypeLibraryLoader.java

示例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);
      }
    });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:RngParser.java

示例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();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:RngParser.java

示例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) {
    }
  }
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:16,代码来源:DatatypeRepertoire.java

示例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;
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:13,代码来源:SchemaBuilderImpl.java

示例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;
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:10,代码来源:DatatypeLibraryLoader.java

示例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;
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:11,代码来源:SchemaBuilderImpl.java

示例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);
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:14,代码来源:SchemaFactoryImpl.java


注:本文中的org.relaxng.datatype.DatatypeLibraryFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。