Package com.clarkparsia.pellet.datatypes.exceptions

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


    try {
      DatatypeConverter.parseInteger( lexicalForm );
    } catch( NumberFormatException e ) {
      log.severe( format( "Number format exception (%s) cause while parsing integer %s", e
          .getMessage(), lexicalForm ) );
      throw new InvalidLiteralException( name, lexicalForm );
    }
    return XSDDecimal.getInstance().getCanonicalRepresentation(
        ATermUtils.makeTypedLiteral( lexicalForm, XSDDecimal.getInstance().getName() ) );
  }
View Full Code Here


    final String lexicalForm = ATermUtils.getLiteralValue( literal );
    try {
      return OWLRealUtils.getCanonicalObject( DatatypeConverter.parseInteger( lexicalForm ) );
    } catch( NumberFormatException e ) {
      throw new InvalidLiteralException( name, lexicalForm );
    }
  }
View Full Code Here

    if (dt == null) {
      switch (PelletOptions.UNDEFINED_DATATYPE_HANDLING) {
        case INFINITE_STRING:
          return literal;
        case EMPTY:
          throw new InvalidLiteralException(dtName, ATermUtils.getLiteralValue(literal));
        case EXCEPTION:
          throw new UnrecognizedDatatypeException(dtName);
        default:
          throw new IllegalStateException();
      }
View Full Code Here

    if (dt == null) {
      switch (PelletOptions.UNDEFINED_DATATYPE_HANDLING) {
        case INFINITE_STRING:
          return literal;
        case EMPTY:
          throw new InvalidLiteralException(dtName, ATermUtils.getLiteralValue(literal));
        case EXCEPTION:
          throw new UnrecognizedDatatypeException(dtName);
        default:
          throw new IllegalStateException();
      }
View Full Code Here

    try {
      DatatypeConverter.parseLong( lexicalForm );
    } catch( NumberFormatException e ) {
      log.severe( format( "Number format exception (%s) cause while parsing long %s", e
          .getMessage(), lexicalForm ) );
      throw new InvalidLiteralException( name, lexicalForm );
    }
    return XSDDecimal.getInstance().getCanonicalRepresentation(
        ATermUtils.makeTypedLiteral( lexicalForm, XSDDecimal.getInstance().getName() ) );
  }
View Full Code Here

    final String lexicalForm = ATermUtils.getLiteralValue( literal );
    try {
      return OWLRealUtils.getCanonicalObject( DatatypeConverter.parseLong( lexicalForm ) );
    } catch( NumberFormatException e ) {
      throw new InvalidLiteralException( name, lexicalForm );
    }
  }
View Full Code Here

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

    final String lexicalForm = ATermUtils.getLiteralValue( literal );
    try {
      return DatatypeConverter.parseDouble( lexicalForm );
    } catch( NumberFormatException e ) {
      throw new InvalidLiteralException( name, lexicalForm );
    }
  }
View Full Code Here

      else
        return ATermUtils.makeTypedLiteral( canonicalForm, getName() );
    } catch( NumberFormatException e ) {
      log.severe( format( "Number format exception (%s) cause while parsing decimal %s", e
          .getMessage(), lexicalForm ) );
      throw new InvalidLiteralException( getName(), lexicalForm );
    }
  }
View Full Code Here

  public Number getValue(ATermAppl literal) throws InvalidLiteralException {
    final String lexicalForm = getLexicalForm( literal );
    try {
      return OWLRealUtils.getCanonicalObject( DatatypeConverter.parseDecimal( lexicalForm ) );
    } catch( NumberFormatException e ) {
      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.