@Override public Serializable parseFromXML(String value) { return parseDouble(value); }
public Double unmarshal(String value) { return ((double)javax.xml.bind.DatatypeConverter.parseDouble(value)); }
public DoubleValImpl(String value) { this(DatatypeConverter.parseDouble(value)); } public DoubleValImpl(double value) {
public Double unmarshal(String value) { return javax.xml.bind.DatatypeConverter.parseDouble(value); }
static public double StringToDoublePrimitive(String value) { try { return DatatypeConverter.parseDouble(value); } catch(Exception e) { throw new IllegalArgumentException("Could not convert to double: "+value, e); } } static public Stream<Double> StringToDouble(Stream<? extends String> values) {
/** * Creates instance from string according to xsd:double definition * * @param val * A string containing lexical representation of xsd:double * @throws NumberFormatException * {@code val} is not a valid string representation of a {@code double} value */ public DoubleValue(final String val) throws NumberFormatException { this(Double.valueOf(DatatypeConverter.parseDouble(val))); }
@Override public Double convertToNotNull(String source) { return Double.valueOf(DatatypeConverter.parseDouble(source)); }
package org.w3._2001.xmlschema; import javax.xml.bind.annotation.adapters.XmlAdapter; public class Adapter1 extends XmlAdapter<String, Double> { public Double unmarshal(String value) { return (javax.xml.bind.DatatypeConverter.parseDouble(value)); } public String marshal(Double value) { if (value == null) { return null; } return (javax.xml.bind.DatatypeConverter.printDouble(value)); } }
public JExpression createConstant(Outline outline, XmlString lexical) { return JExpr.lit(DatatypeConverter.parseDouble(lexical.value)); } };
public JExpression createConstant(Outline outline, XmlString lexical) { return JExpr.lit(DatatypeConverter.parseDouble(lexical.value)); } };
public JExpression createConstant(Outline outline, XmlString lexical) { return JExpr.lit(DatatypeConverter.parseDouble(lexical.value)); } };
public Double getValue(ATermAppl literal) throws InvalidLiteralException { final String lexicalForm = getLexicalForm( literal ); try { return DatatypeConverter.parseDouble( lexicalForm ); } catch( NumberFormatException e ) { throw new InvalidLiteralException( getName(), lexicalForm ); } }
public Double getValue(ATermAppl literal) throws InvalidLiteralException { if( !ATermUtils.isLiteral( literal ) ) throw new IllegalArgumentException(); if( !literal.getArgument( ATermUtils.LIT_URI_INDEX ).equals( name ) ) throw new IllegalArgumentException(); final String lexicalForm = ATermUtils.getLiteralValue( literal ); try { return DatatypeConverter.parseDouble( lexicalForm ); } catch( NumberFormatException e ) { throw new InvalidLiteralException( name, lexicalForm ); } }
public Double getValue(ATermAppl literal) throws InvalidLiteralException { final String lexicalForm = getLexicalForm( literal ); try { return DatatypeConverter.parseDouble( lexicalForm ); } catch( NumberFormatException e ) { throw new InvalidLiteralException( getName(), lexicalForm ); } }
@Override public Double getValue(final ATermAppl literal) throws InvalidLiteralException { final String lexicalForm = getLexicalForm(literal); try { return DatatypeConverter.parseDouble(lexicalForm); } catch (final NumberFormatException e) { throw new InvalidLiteralException(getName(), lexicalForm, e); } }
public Double getValue(ATermAppl literal) throws InvalidLiteralException { if( !ATermUtils.isLiteral( literal ) ) throw new IllegalArgumentException(); if( !literal.getArgument( ATermUtils.LIT_URI_INDEX ).equals( name ) ) throw new IllegalArgumentException(); final String lexicalForm = ATermUtils.getLiteralValue( literal ); try { return DatatypeConverter.parseDouble( lexicalForm ); } catch( NumberFormatException e ) { throw new InvalidLiteralException( name, lexicalForm ); } }
@Override public Double getValue(final ATermAppl literal) throws InvalidLiteralException { final String lexicalForm = getLexicalForm(literal); try { return DatatypeConverter.parseDouble(lexicalForm); } catch (final NumberFormatException e) { throw new InvalidLiteralException(getName(), lexicalForm, e); } }
public ATermAppl getCanonicalRepresentation(ATermAppl input) throws InvalidLiteralException { if( !ATermUtils.isLiteral( input ) ) throw new IllegalArgumentException(); if( !input.getArgument( ATermUtils.LIT_URI_INDEX ).equals( name ) ) throw new IllegalArgumentException(); final String lexicalForm = ATermUtils.getLiteralValue( input ); try { final Double f = DatatypeConverter.parseDouble( lexicalForm ); /* * TODO: Determine if this is, in fact a functional mapping */ final String canonicalForm = DatatypeConverter.printDouble( f ); if( canonicalForm.equals( lexicalForm ) ) return input; else return ATermUtils.makeTypedLiteral( canonicalForm, name ); } catch( NumberFormatException e ) { log.severe( format( "Number format exception (%s) cause while parsing double %s", e .getMessage(), lexicalForm ) ); throw new InvalidLiteralException( name, lexicalForm ); } }
@Override public Double getValue(final ATermAppl literal) throws InvalidLiteralException { if (!ATermUtils.isLiteral(literal)) throw new IllegalArgumentException(); if (!literal.getArgument(ATermUtils.LIT_URI_INDEX).equals(name)) throw new IllegalArgumentException(); final String lexicalForm = ATermUtils.getLiteralValue(literal); try { return DatatypeConverter.parseDouble(lexicalForm); } catch (final NumberFormatException e) { throw new InvalidLiteralException(name, lexicalForm, e); } }
@Override public Double getValue(final ATermAppl literal) throws InvalidLiteralException { if (!ATermUtils.isLiteral(literal)) throw new IllegalArgumentException(); if (!literal.getArgument(ATermUtils.LIT_URI_INDEX).equals(name)) throw new IllegalArgumentException(); final String lexicalForm = ATermUtils.getLiteralValue(literal); try { return DatatypeConverter.parseDouble(lexicalForm); } catch (final NumberFormatException e) { throw new InvalidLiteralException(name, lexicalForm, e); } }