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


Java TypeConstraintException类代码示例

本文整理汇总了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;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:12,代码来源:VirtualNetworkFunctionDescriptor.java

示例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.");
}
 
开发者ID:matomo-org,项目名称:piwik-java-tracker,代码行数:13,代码来源:PiwikRequest.java

示例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.");
}
 
开发者ID:matomo-org,项目名称:piwik-java-tracker,代码行数:13,代码来源:PiwikRequest.java

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

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

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

示例7: testRpartitionWithPatternException

import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testRpartitionWithPatternException() {
  rs.rpartition((Pattern) null);
}
 
开发者ID:wnameless,项目名称:rubycollect4j,代码行数:5,代码来源:RubyStringTest.java

示例8: testSqueezeWithCharSetException

import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testSqueezeWithCharSetException() {
  rs("  now   is  the").squeeze(null);
}
 
开发者ID:wnameless,项目名称:rubycollect4j,代码行数:5,代码来源:RubyStringTest.java

示例9: testLindexWithPatternAndStopAtException

import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testLindexWithPatternAndStopAtException() {
  rs.rindex((Pattern) null, -1);
}
 
开发者ID:wnameless,项目名称:rubycollect4j,代码行数:5,代码来源:RubyStringTest.java

示例10: testTrSException1

import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testTrSException1() {
  rs.trS(null, "");
}
 
开发者ID:wnameless,项目名称:rubycollect4j,代码行数:5,代码来源:RubyStringTest.java

示例11: testUptoWithExclusiveAndBlockException

import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testUptoWithExclusiveAndBlockException() {
  rs.upto(null, true, (Consumer<String>) null);
}
 
开发者ID:wnameless,项目名称:rubycollect4j,代码行数:5,代码来源:RubyStringTest.java

示例12: testSliceWithPatternException

import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testSliceWithPatternException() {
  rs.slice((Pattern) null);
}
 
开发者ID:wnameless,项目名称:rubycollect4j,代码行数:5,代码来源:RubyStringTest.java

示例13: testCountException1

import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testCountException1() {
  RubyStrings.count(rs, (String) null);
}
 
开发者ID:wnameless,项目名称:rubycollect4j,代码行数:5,代码来源:RubyStringsTest.java

示例14: testCryptException

import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testCryptException() {
  RubyStrings.crypt(rs, null);
}
 
开发者ID:wnameless,项目名称:rubycollect4j,代码行数:5,代码来源:RubyStringsTest.java

示例15: testDeleteException

import javax.xml.bind.TypeConstraintException; //导入依赖的package包/类
@Test(expected = TypeConstraintException.class)
public void testDeleteException() {
  RubyStrings.delete(rs, null);
}
 
开发者ID:wnameless,项目名称:rubycollect4j,代码行数:5,代码来源:RubyStringsTest.java


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