Java Code Examples for javax.xml.bind.DatatypeConverter#parseBoolean()

The following examples show how to use javax.xml.bind.DatatypeConverter#parseBoolean() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WisItUtils.java    From OpenEstate-IO with Apache License 2.0 5 votes vote down vote up
public static Boolean parseYesNo(String value) {
    value = StringUtils.trimToNull(value);
    if ("ja".equalsIgnoreCase(value))
        return Boolean.TRUE;
    else if ("nein".equalsIgnoreCase(value))
        return Boolean.FALSE;
    else if (value != null)
        return DatatypeConverter.parseBoolean(value);
    else
        throw new IllegalArgumentException("Can't parse boolean value!");
}
 
Example 2
Source File: CloverBooleanConvertor.java    From CloverETL-Engine with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static Boolean parseXsdBooleanToBoolean(String value) throws DataConversionException {
    Boolean result = null;
    try {
        result = DatatypeConverter.parseBoolean(value);    
    } catch(Exception e) {
        logger.fatal("Unable to parse xsd:boolean to "+Boolean.class.getName()+".",e);
        throw new DataConversionException("Unable to parse xsd:boolean to "+Boolean.class.getName()+".", e);
    }
    
    return result;
}
 
Example 3
Source File: ValueConverter.java    From java-client-api with Apache License 2.0 5 votes vote down vote up
static public boolean StringToBooleanPrimitive(String value) {
  try {
    return DatatypeConverter.parseBoolean(value);
  } catch(Exception e) {
    throw new IllegalArgumentException("Could not convert to boolean: "+value, e);
  }
}
 
Example 4
Source File: ZeroOneBooleanAdapter.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public Boolean unmarshal(String v) {
    if(v==null)     return null;
    return DatatypeConverter.parseBoolean(v);
}
 
Example 5
Source File: ZeroOneBooleanAdapter.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public Boolean unmarshal(String v) {
    if(v==null)     return null;
    return DatatypeConverter.parseBoolean(v);
}
 
Example 6
Source File: ZeroOneBooleanAdapter.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public Boolean unmarshal(String v) {
    if(v==null)     return null;
    return DatatypeConverter.parseBoolean(v);
}
 
Example 7
Source File: ZeroOneBooleanAdapter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public Boolean unmarshal(String v) {
    if(v==null)     return null;
    return DatatypeConverter.parseBoolean(v);
}
 
Example 8
Source File: ZeroOneBooleanAdapter.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public Boolean unmarshal(String v) {
    if(v==null)     return null;
    return DatatypeConverter.parseBoolean(v);
}
 
Example 9
Source File: ZeroOneBooleanAdapter.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public Boolean unmarshal(String v) {
    if(v==null)     return null;
    return DatatypeConverter.parseBoolean(v);
}
 
Example 10
Source File: ZeroOneBooleanAdapter.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public Boolean unmarshal(String v) {
    if(v==null)     return null;
    return DatatypeConverter.parseBoolean(v);
}
 
Example 11
Source File: ZeroOneBooleanAdapter.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public Boolean unmarshal(String v) {
    if(v==null)     return null;
    return DatatypeConverter.parseBoolean(v);
}
 
Example 12
Source File: KyeroUtils.java    From OpenEstate-IO with Apache License 2.0 4 votes vote down vote up
public static Boolean parseBoolType(String value) {
    value = StringUtils.trimToNull(value);
    return (value != null) ? DatatypeConverter.parseBoolean(value) : null;
}
 
Example 13
Source File: XsValueImpl.java    From java-client-api with Apache License 2.0 4 votes vote down vote up
public BooleanValImpl(String value) {
    this(DatatypeConverter.parseBoolean(value));
}