Package com.clarkparsia.pellet.datatypes.exceptions

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


       * Start with the full data range for the datatype
       */
      final ATermAppl dtTerm = (ATermAppl) a.getArgument(0);
      final DataRange<?> dt = getDataRange(dtTerm);
      if (!(dt instanceof RestrictedDatatype<?>)) {
        throw new InvalidConstrainingFacetException(dtTerm, dt);
      }

      RestrictedDatatype<?> dr = (RestrictedDatatype<?>) dt;

      /*
       * Apply each constraining facet value pair in turn
       */
      final ATermList facetValues = (ATermList) a.getArgument(1);
      for (ATermList l = facetValues; !l.isEmpty(); l = l.getNext()) {
        final ATermAppl fv = (ATermAppl) l.getFirst();
        final ATermAppl facet = (ATermAppl) fv.getArgument(0);
        final ATermAppl valueTerm = (ATermAppl) fv.getArgument(1);

        Object value;
        try {
          value = getValue(valueTerm);
        }
        catch (InvalidLiteralException e) {
          throw new InvalidConstrainingFacetException(facet, valueTerm, e);
        }
        dr = dr.applyConstrainingFacet(facet, value);
      }

      return dr;
View Full Code Here


    if( f == null ) {
      final String msg = format(
          "Attempt to constrain datatype (%s) with unsupported constraining facet ('%s' , '%s')",
          getDatatype(), facet, value );
      log.severe( msg );
      throw new InvalidConstrainingFacetException( msg, facet, value );
    }

    /*
     * Check the value
     */
    XMLGregorianCalendar c = null;
    if( value instanceof XMLGregorianCalendar ) {
      c = (XMLGregorianCalendar) value;
    }
    if( c == null || !isValidValue( c ) ) {
      final String msg = format(
          "Attempt to constrain datatype (%s) using constraining facet ('%s') with an unsupported value ('%s')",
          getDatatype(), f, value );
      log.severe( msg );
      throw new InvalidConstrainingFacetException( msg, facet, value );
    }

    Number lower, upper;
    boolean inclusiveLower, inclusiveUpper;
    if( XSD.MAX_EXCLUSIVE.equals( f ) ) {
View Full Code Here

    this.permitTrue = permitTrue;
  }

  public RestrictedDatatype<Boolean> applyConstrainingFacet(ATermAppl facet, Object value)
      throws InvalidConstrainingFacetException {
    throw new InvalidConstrainingFacetException( facet, value );
  }
View Full Code Here

TOP

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

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.