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


Java DatatypeLibrary类代码示例

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

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

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

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

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

示例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();
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:20,代码来源:SchemaBuilderImpl.java

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

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

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

示例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;
}
 
开发者ID:kohsuke,项目名称:rngom,代码行数:9,代码来源:CachedDatatypeLibraryFactory.java

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

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

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

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

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


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