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


Java DatatypeException.getMessage方法代码示例

本文整理汇总了Java中org.relaxng.datatype.DatatypeException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java DatatypeException.getMessage方法的具体用法?Java DatatypeException.getMessage怎么用?Java DatatypeException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.relaxng.datatype.DatatypeException的用法示例。


在下文中一共展示了DatatypeException.getMessage方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addParam

import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
public void addParam(String name, String value, Context context, String ns, Location loc, Annotations anno)
        throws BuildException {
    try {
        dtb.addParameter(name, value, new ValidationContextImpl(context, ns));
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        int pos = e.getIndex();
        String displayedParam;
        if (pos == DatatypeException.UNKNOWN) {
            displayedParam = null;
        } else {
            displayedParam = displayParam(value, pos);
        }
        if (displayedParam != null) {
            if (detail != null) {
                error("invalid_param_detail_display", detail, displayedParam, (Locator) loc);
            } else {
                error("invalid_param_display", displayedParam, (Locator) loc);
            }
        } else if (detail != null) {
            error("invalid_param_detail", detail, (Locator) loc);
        } else {
            error("invalid_param", (Locator) loc);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:SchemaBuilderImpl.java

示例2: makeDataPatternBuilder

import org.relaxng.datatype.DatatypeException; //导入方法依赖的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

示例3: makeDataPatternBuilder

import org.relaxng.datatype.DatatypeException; //导入方法依赖的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

示例4: DataPatternBuilderImpl

import org.relaxng.datatype.DatatypeException; //导入方法依赖的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

示例5: makePattern

import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
public ParsedPattern makePattern(Location loc, Annotations anno)
        throws BuildException {
    try {
        return pb.makeData(dtb.createDatatype());
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        if (detail != null) {
            error("invalid_params_detail", detail, (Locator) loc);
        } else {
            error("invalid_params", (Locator) loc);
        }
        return pb.makeError();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:SchemaBuilderImpl.java

示例6: addParam

import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
public void addParam(String name, String value, Context context, String ns, Locator loc, AnnotationsImpl anno)
           throws BuildException {
     try {
       dtb.addParameter(name, value, new ValidationContextImpl(context, ns));
       params.add(name);
       params.add(value);
     }
     catch (DatatypeException e) {
String detail = e.getMessage();
       int pos = e.getIndex();
       String displayedParam;
       if (pos == DatatypeException.UNKNOWN)
         displayedParam = null;
       else
         displayedParam = displayParam(value, pos);
       if (displayedParam != null) {
         if (detail != null)
           error("invalid_param_detail_display", detail, displayedParam, loc);
         else
           error("invalid_param_display", displayedParam, loc);
       }
else if (detail != null)
  error("invalid_param_detail", detail, loc);
else
  error("invalid_param", loc);
     }
   }
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:28,代码来源:SchemaBuilderImpl.java

示例7: makePattern

import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
public Pattern makePattern(Locator loc, AnnotationsImpl anno)
           throws BuildException {
     try {
       return pb.makeData(dtb.createDatatype(), dtName, params);
     }
     catch (DatatypeException e) {
String detail = e.getMessage();
if (detail != null)
  error("invalid_params_detail", detail, loc);
else
  error("invalid_params", loc);
       return pb.makeError();
     }
   }
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:15,代码来源:SchemaBuilderImpl.java

示例8: diagnoseDatatypeException

import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
private void diagnoseDatatypeException(String detailKey, String noDetailKey, DatatypeException e, SourceLocation loc)
  throws BuildException {
  String detail = e.getMessage();
  if (detail != null)
    error(detailKey, detail, loc);
  else
    error(noDetailKey, loc);
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:9,代码来源:SchemaBuilderImpl.java

示例9: testCreateDatatype

import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
@Test
public void testCreateDatatype() throws DatatypeException {
  Datatype dt = lib.createDatatype("integer");
  try {
    dt.checkValid("foo", null);
  }
  catch (DatatypeException e) {
    String message = e.getMessage();
    Assert.assertNotNull(message);
    Assert.assertTrue(message.contains("integer"));
  }
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:13,代码来源:DatatypeLibraryImplTest.java

示例10: DataDerivFailure

import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
DataDerivFailure(DataPattern p, DatatypeException e) {
  this(p.getDatatype(), p.getDatatypeName(), p.getParams(), e.getMessage(), e.getIndex());
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:4,代码来源:DataDerivFailure.java


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