本文整理汇总了Java中javax.xml.bind.TypeConstraintException类的典型用法代码示例。如果您正苦于以下问题:Java TypeConstraintException类的具体用法?Java TypeConstraintException怎么用?Java TypeConstraintException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypeConstraintException类属于javax.xml.bind包,在下文中一共展示了TypeConstraintException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setConnection_point
import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Override
public void setConnection_point(Set<ConnectionPoint> connection_point) {
for (ConnectionPoint cp : connection_point)
if (!(cp instanceof VNFDConnectionPoint))
throw new TypeConstraintException(
"Connection Point "
+ cp.getId()
+ " field must be an instance of "
+ ConnectionPoint.class.getCanonicalName());
this.connection_point = connection_point;
}
示例2: returnAsUrl
import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
private URL returnAsUrl(String parameter, String name, String altMethod){
Object obj = getParameter(parameter);
if (obj == null){
return null;
}
if (obj instanceof URL){
return (URL)obj;
}
throw new TypeConstraintException("The stored " + name +
" is a String, not a URL. Use \""+
altMethod + "\" instead.");
}
示例3: returnAsString
import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
private String returnAsString(String parameter, String name, String altMethod){
Object obj = getParameter(parameter);
if (obj == null){
return null;
}
if (obj instanceof String){
return (String)obj;
}
throw new TypeConstraintException("The stored " + name +
" is a URL, not a String. Use \""+
altMethod + "\" instead.");
}
示例4: stringify
import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
private String stringify(Object o) {
if (o == null) throw new TypeConstraintException(
"TypeError: no implicit conversion of null into String");
if (o instanceof String) return (String) o;
if (o instanceof CharSequence) {
CharSequence cs = (CharSequence) o;
return new StringBuilder(cs.length()).append(cs).toString();
}
return o.toString();
}
示例5: partition
import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
/**
* Searches sep in the string and returns the part before it, the match, and
* the part after it. If it is not found, returns two empty strings and str.
*
* @param sep
* @return {@link RubyArray}
*/
public RubyArray<String> partition(String sep) {
if (sep == null)
throw new TypeConstraintException("TypeError: type mismatch: null given");
int sepIndex = str.indexOf(sep);
if (sepIndex == -1) return Ruby.Array.of(str, "", "");
return Ruby.Array.of(str.substring(0, sepIndex), sep,
str.substring(sepIndex + sep.length()));
}
示例6: slice
import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
/**
* Returns the matching portion of the string.
*
* @param pattern
* a Pattern
* @return new {@link RubyString} or null
*/
public RubyString slice(Pattern pattern) {
if (pattern == null)
throw new TypeConstraintException("TypeError: type mismatch: null given");
Matcher matcher = pattern.matcher(str);
if (matcher.find())
return Ruby.String.of(matcher.group());
else
return null;
}
示例7: testRpartitionWithPatternException
import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testRpartitionWithPatternException() {
rs.rpartition((Pattern) null);
}
示例8: testSqueezeWithCharSetException
import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testSqueezeWithCharSetException() {
rs(" now is the").squeeze(null);
}
示例9: testLindexWithPatternAndStopAtException
import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testLindexWithPatternAndStopAtException() {
rs.rindex((Pattern) null, -1);
}
示例10: testTrSException1
import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testTrSException1() {
rs.trS(null, "");
}
示例11: testUptoWithExclusiveAndBlockException
import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testUptoWithExclusiveAndBlockException() {
rs.upto(null, true, (Consumer<String>) null);
}
示例12: testSliceWithPatternException
import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testSliceWithPatternException() {
rs.slice((Pattern) null);
}
示例13: testCountException1
import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testCountException1() {
RubyStrings.count(rs, (String) null);
}
示例14: testCryptException
import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testCryptException() {
RubyStrings.crypt(rs, null);
}
示例15: testDeleteException
import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testDeleteException() {
RubyStrings.delete(rs, null);
}