Package com.clarkparsia.pellet.datatypes.exceptions

Examples of com.clarkparsia.pellet.datatypes.exceptions.InvalidLiteralException


  @Override
  protected Number fromLexicalForm(String lexicalForm) throws InvalidLiteralException {
    try {
      int n = DatatypeConverter.parseInt( lexicalForm );
      if( n < Byte.MIN_VALUE || n > Byte.MAX_VALUE )
        throw new InvalidLiteralException( getName(), lexicalForm );
      return Byte.valueOf( (byte) n );
    } catch( NumberFormatException e ) {
      throw new InvalidLiteralException( getName(), lexicalForm );
    }
  }
View Full Code Here


  @Override
  protected Number fromLexicalForm(String lexicalForm) throws InvalidLiteralException {
    try {
      return DatatypeConverter.parseInteger( lexicalForm );
    } catch( NumberFormatException e ) {
      throw new InvalidLiteralException( getName(), lexicalForm );
    }
  }
View Full Code Here

  @Override
  protected Number fromLexicalForm(String lexicalForm) throws InvalidLiteralException {
    try {
      final BigInteger n = DatatypeConverter.parseInteger( lexicalForm );
      if( BigInteger.ZERO.compareTo( n ) >= 0 )
        throw new InvalidLiteralException( getName(), lexicalForm );
      return n;
    } catch( NumberFormatException e ) {
      throw new InvalidLiteralException( getName(), lexicalForm );
    }
  }
View Full Code Here

  @Override
  protected Number fromLexicalForm(String lexicalForm) throws InvalidLiteralException {
    try {
      final BigInteger n = DatatypeConverter.parseInteger( lexicalForm );
      if( BigInteger.ZERO.compareTo( n ) > 0 )
        throw new InvalidLiteralException( getName(), lexicalForm );
      if( MAX_VALUE.compareTo( n ) < 0 )
        throw new InvalidLiteralException( getName(), lexicalForm );
      return n;
    } catch( NumberFormatException e ) {
      throw new InvalidLiteralException( getName(), lexicalForm );
    }
  }
View Full Code Here

  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 );
    }
  }
View Full Code Here

  public Float getValue(ATermAppl literal) throws InvalidLiteralException {
    final String lexicalForm = getLexicalForm( literal );
    try {
      return DatatypeConverter.parseFloat( lexicalForm );
    } catch( NumberFormatException e ) {
      throw new InvalidLiteralException( getName(), lexicalForm );
    }
  }
View Full Code Here

    return dataRange;
  }

  public ATermAppl getCanonicalRepresentation(ATermAppl input) throws InvalidLiteralException {
    final String lexicalForm = getLexicalForm( input );
    throw new InvalidLiteralException( getName(), lexicalForm );
  }
View Full Code Here

    return this;
  }

  public Number getValue(ATermAppl literal) throws InvalidLiteralException {
    final String lexicalForm = getLexicalForm( literal );
    throw new InvalidLiteralException( getName(), lexicalForm );
  }
View Full Code Here

  @Override
  protected Number fromLexicalForm(String lexicalForm) throws InvalidLiteralException {
    try {
      final int i = DatatypeConverter.parseInt( lexicalForm );
      if( i < 0 )
        throw new InvalidLiteralException( getName(), lexicalForm );
      if( i > MAX_VALUE )
        throw new InvalidLiteralException( getName(), lexicalForm );
      return i;
    } catch( NumberFormatException e ) {
      throw new InvalidLiteralException( getName(), lexicalForm );
    }
  }
View Full Code Here

    } catch( IllegalArgumentException e ) {
      /*
       * newXMLGregorianCalendar will throw an IllegalArgumentException if
       * the lexical form is not one of the XML Schema datetime types
       */
      throw new InvalidLiteralException( getName(), lexicalForm );
    } catch( IllegalStateException e ) {
      /*
       * getXMLSchemaType will throw an IllegalStateException if the
       * combination of fields set in the calendar object doesn't match
       * one of the XML Schema datetime types
       */
      throw new InvalidLiteralException( getName(), lexicalForm );
    }
  }
View Full Code Here

TOP

Related Classes of com.clarkparsia.pellet.datatypes.exceptions.InvalidLiteralException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.