本文整理汇总了Java中org.relaxng.datatype.DatatypeException.initCause方法的典型用法代码示例。如果您正苦于以下问题:Java DatatypeException.initCause方法的具体用法?Java DatatypeException.initCause怎么用?Java DatatypeException.initCause使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.relaxng.datatype.DatatypeException
的用法示例。
在下文中一共展示了DatatypeException.initCause方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkNmtoken
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
private void checkNmtoken(String text, int i)
throws DatatypeException
{
try
{
int[] cp = UnicodeReader.toCodePointArray(text);
if (cp.length == 0)
throw new DatatypeException("invalid NMTOKEN value");
for (int j = 0; j < cp.length; j++)
{
// XXX XML 1.1 documents?
if (!XMLParser.isNameCharacter(cp[j], false))
throw new DatatypeException(i, "invalid NMTOKEN value");
}
}
catch (IOException e)
{
DatatypeException e2 = new DatatypeException("invalid NMTOKEN value");
e2.initCause(e);
throw e2;
}
}
示例2: checkValid
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
public void checkValid(String value, ValidationContext context)
throws DatatypeException
{
super.checkValid(value, context);
if (SPECIAL.contains(value))
return;
try
{
Double.parseDouble(value);
}
catch (NumberFormatException e)
{
DatatypeException e2 = new DatatypeException("invalid double value");
e2.initCause(e);
throw e2;
}
}
示例3: checkValid
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
public void checkValid(String value, ValidationContext context)
throws DatatypeException
{
super.checkValid(value, context);
try
{
int[] cp = UnicodeReader.toCodePointArray(value);
if (cp.length == 0)
throw new DatatypeException("invalid Name value");
// XXX XML 1.1 documents?
if (!XMLParser.isNameStartCharacter(cp[0], false))
throw new DatatypeException(0, "invalid Name value");
for (int i = 1; i < cp.length; i++)
{
if (!XMLParser.isNameCharacter(cp[i], false))
throw new DatatypeException(i, "invalid Name value");
}
}
catch (IOException e)
{
DatatypeException e2 = new DatatypeException("invalid Name value");
e2.initCause(e);
throw e2;
}
}
示例4: checkValid
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
public void checkValid(String value, ValidationContext context)
throws DatatypeException
{
super.checkValid(value, context);
try
{
new URI(value);
}
catch (URISyntaxException e)
{
DatatypeException e2 = new DatatypeException(e.getIndex(),
e.getReason());
e2.initCause(e);
throw e2;
}
}
示例5: checkValid
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
public void checkValid(String value, ValidationContext context)
throws DatatypeException
{
super.checkValid(value, context);
try
{
int[] cp = UnicodeReader.toCodePointArray(value);
if (cp.length == 0)
throw new DatatypeException("invalid NMTOKEN value");
for (int i = 0; i < cp.length; i++)
{
// XXX XML 1.1 documents?
if (!XMLParser.isNameCharacter(cp[i], false))
throw new DatatypeException(i, "invalid NMTOKEN value");
}
}
catch (IOException e)
{
DatatypeException e2 = new DatatypeException("invalid NMTOKEN value");
e2.initCause(e);
throw e2;
}
}
示例6: checkValid
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
public void checkValid(String value, ValidationContext context)
throws DatatypeException
{
super.checkValid(value, context);
if (SPECIAL.contains(value))
return;
try
{
Float.parseFloat(value);
}
catch (NumberFormatException e)
{
DatatypeException e2 = new DatatypeException("invalid float value");
e2.initCause(e);
throw e2;
}
}
示例7: checkValid
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
public void checkValid(String value, ValidationContext context)
throws DatatypeException
{
super.checkValid(value, context);
try
{
int[] cp = UnicodeReader.toCodePointArray(value);
if (cp.length == 0)
throw new DatatypeException("invalid NCName value");
// XXX XML 1.1 documents?
if (cp[0] == ':' || !XMLParser.isNameStartCharacter(cp[0], false))
throw new DatatypeException(0, "invalid NCName value");
boolean seenColon = false;
for (int i = 1; i < cp.length; i++)
{
if (cp[i] == ':')
{
if (seenColon || (i + 1 == cp.length))
throw new DatatypeException(i, "invalid NCName value");
seenColon = true;
}
else if (!XMLParser.isNameCharacter(cp[i], false))
throw new DatatypeException(i, "invalid NCName value");
}
}
catch (IOException e)
{
DatatypeException e2 = new DatatypeException("invalid NCName value");
e2.initCause(e);
throw e2;
}
}
示例8: checkValid
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
public void checkValid(String value, ValidationContext context)
throws DatatypeException
{
super.checkValid(value, context);
int ci = -1;
try
{
int[] cp = UnicodeReader.toCodePointArray(value);
if (cp.length == 0)
throw new DatatypeException("invalid NCName value");
// XXX XML 1.1 documents?
if (cp[0] == ':' || !XMLParser.isNameStartCharacter(cp[0], false))
throw new DatatypeException(0, "invalid NCName value");
for (int i = 1; i < cp.length; i++)
{
if (cp[i] == ':')
{
if (ci != -1 || (i + 1 == cp.length))
throw new DatatypeException(i, "invalid NCName value");
ci = i;
}
else if (!XMLParser.isNameCharacter(cp[i], false))
throw new DatatypeException(i, "invalid NCName value");
}
}
catch (IOException e)
{
DatatypeException e2 = new DatatypeException("invalid NCName value");
e2.initCause(e);
throw e2;
}
if (ci != -1)
{
String prefix = value.substring(0, ci);
if (context.resolveNamespacePrefix(prefix) == null)
throw new DatatypeException("invalid namespace prefix");
}
}