Examples of MetaModelException


Examples of org.apache.isis.core.metamodel.exceptions.MetaModelException

            processMethodContext.removeMethod(choicesMethod);

            final FacetedMethod facetedMethod = processMethodContext.getFacetHolder();
            if (facetedMethod.containsDoOpFacet(ActionChoicesFacet.class)) {
                final Class<?> cls = processMethodContext.getCls();
                throw new MetaModelException(cls + " uses both old and new choices syntax - must use one or other");
            }

            // add facets directly to parameters, not to actions
            final FacetedMethodParameter paramAsHolder = parameters.get(i);
            FacetUtil.addFacet(new ActionParameterChoicesFacetViaMethod(choicesMethod, arrayOfParamType, paramAsHolder, getSpecificationLoader(), getAdapterManager()));
View Full Code Here

Examples of org.apache.isis.core.metamodel.exceptions.MetaModelException

            names = (String[]) MethodExtensions.invokeStatic(namesMethod, new Object[0]);
        } catch (final ClassCastException ex) {
            // ignore
        }
        if (names == null || names.length != numElementsRequired) {
            throw new MetaModelException(namesMethod + " must return an String[] array of same size as number of parameters of action");
        }
        return names;
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.exceptions.MetaModelException

            descriptions = (String[]) MethodExtensions.invokeStatic(descriptionMethod, new Object[0]);
        } catch (final ClassCastException ex) {
            // ignore
        }
        if (descriptions == null || descriptions.length != numElementsRequired) {
            throw new MetaModelException(descriptionMethod + " must return an String[] array of same size as number of parameters of action");
        }
        return descriptions;
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.exceptions.MetaModelException

            optionals = (boolean[]) MethodExtensions.invokeStatic(optionalMethod, new Object[0]);
        } catch (final ClassCastException ex) {
            // ignore, test below
        }
        if (optionals == null || optionals.length != numElementsRequired) {
            throw new MetaModelException(optionalMethod + " must return an boolean[] array of same size as number of parameters of action");
        }
        return optionals;
    }
View Full Code Here

Examples of org.apache.metamodel.MetaModelException

        if (e instanceof SQLException) {
            return JdbcUtils.wrapException((SQLException) e, message);
        } else if (e instanceof RuntimeException) {
            return (RuntimeException) e;
        } else {
            return new MetaModelException(message, e);
        }
    }
View Full Code Here

Examples of org.apache.metamodel.MetaModelException

      _connection = DriverManager.getConnection(url, "SA", "");
      _connection.setReadOnly(true);
      _dataContextDelegate = new JdbcDataContext(_connection,
          TableType.DEFAULT_TABLE_TYPES, null);
    } catch (Exception e) {
      throw new MetaModelException(e);
    }
  }
View Full Code Here

Examples of org.apache.metamodel.MetaModelException

                    column.setColumnNumber(columnNumber);
                    columnNumber++;
                    addColumn(column);
                }
            } catch (Exception e) {
                throw new MetaModelException("Could not resolve table ", e);
            }
        }
        return columnsInternal;
    }
View Full Code Here

Examples of org.apache.metamodel.MetaModelException

    } else if (klass.equals(BigDecimal.class)) {
      return Bytes
          .toBytes(value instanceof BigDecimal ? (BigDecimal) value
              : new BigDecimal(value.toString()));
    } else {
      throw new MetaModelException(
          "Could not find a suitable Type to assign value for give type "
              + klass.getName());
    }
  }
View Full Code Here

Examples of org.apache.metamodel.MetaModelException

        || klass.isAssignableFrom(Short.class)) {
      return Bytes.toShort(b);
    } else if (klass.equals(BigDecimal.class)) {
      return Bytes.toBigDecimal(b);
    } else {
      throw new MetaModelException("Could Not find a suitable Type for "
          + klass.getName());
    }
  }
View Full Code Here

Examples of org.apache.metamodel.MetaModelException

            _rowNumber++;
            _row = new SingleLineCsvRow(this, line, _columnsInTable, _failOnInconsistentRowLength, _rowNumber);
            return true;
        } catch (IOException e) {
            close();
            throw new MetaModelException("IOException occurred while reading next line of CSV resource", e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.