Examples of FunctionMetadataException


Examples of org.teiid.api.exception.query.FunctionMetadataException

     * @param param The parameter to validate
     * @throws FunctionMetadataException Thrown if function parameter is not valid in some way
     */
    public static final void validateFunctionParameter(FunctionParameter param) throws FunctionMetadataException {
        if(param == null) {
            throw new FunctionMetadataException("ERR.015.001.0053", QueryPlugin.Util.getString("ERR.015.001.0053")); //$NON-NLS-1$ //$NON-NLS-2$
        }

        // Validate attributes
        validateName(param.getName());
        validateType(param.getType());
View Full Code Here

Examples of org.teiid.api.exception.query.FunctionMetadataException

     */
    public static final void validateType(String type) throws FunctionMetadataException {
        validateIsNotNull(type, "Type"); //$NON-NLS-1$

        if(DataTypeManager.getDataTypeClass(type) == null) {
            throw new FunctionMetadataException("ERR.015.001.0054", QueryPlugin.Util.getString("ERR.015.001.0054", type)); //$NON-NLS-1$ //$NON-NLS-2$
        }
    }
View Full Code Here

Examples of org.teiid.api.exception.query.FunctionMetadataException

     * @param objName Object name used when throwing exception
     * @throws FunctionMetadataException Thrown when object == null
     */
  private static final void validateIsNotNull(Object object, String objName) throws FunctionMetadataException {
    if(object == null) {
        throw new FunctionMetadataException("ERR.015.001.0052", QueryPlugin.Util.getString("ERR.015.001.0052", objName)); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
View Full Code Here

Examples of org.teiid.api.exception.query.FunctionMetadataException

     * @param strName Name of string to use in exception message
     * @throws FunctionMetadataException Thrown when string.length() > maxLength
     */
  private static final void validateLength(String string, int maxLength, String strName) throws FunctionMetadataException {
     if(string.length() > maxLength) {
        throw new FunctionMetadataException("ERR.015.001.0055", QueryPlugin.Util.getString("ERR.015.001.0055",strName, new Integer(maxLength))); //$NON-NLS-1$ //$NON-NLS-2$
     }
  }
View Full Code Here

Examples of org.teiid.api.exception.query.FunctionMetadataException

     * @param strName String to use in exception message
     * @throws FunctionMetadataException Thrown when string uses characters not in allowed character sets
     */
  private static final void validateNameCharacters(String name, String strName) throws FunctionMetadataException {
    if (name.indexOf('.') > 0) {
      throw new FunctionMetadataException("ERR.015.001.0057", QueryPlugin.Util.getString("ERR.015.001.0057",strName, '.')); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
View Full Code Here

Examples of org.teiid.api.exception.query.FunctionMetadataException

  private static final void validateJavaIdentifier(String identifier, String strName, boolean allowMultiple) throws FunctionMetadataException {
      // First check first character
    if(identifier.length() > 0) {
      char firstChar = identifier.charAt(0);
      if(! Character.isJavaIdentifierStart(firstChar)) {
         throw new FunctionMetadataException("ERR.015.001.0056", QueryPlugin.Util.getString("ERR.015.001.0056",strName, new Character(firstChar))); //$NON-NLS-1$ //$NON-NLS-2$
      }

      // Then check the rest of the characters
      for(int i=1; i<identifier.length(); i++) {
        char ch = identifier.charAt(i);
        if(! Character.isJavaIdentifierPart(ch)) {
            if(! allowMultiple || ! (ch == '.')) {
             throw new FunctionMetadataException("ERR.015.001.0057", QueryPlugin.Util.getString("ERR.015.001.0057",strName, new Character(ch))); //$NON-NLS-1$ //$NON-NLS-2$
            }
        }
      }

      if(identifier.charAt(identifier.length()-1) == '.') {
         throw new FunctionMetadataException("ERR.015.001.0058", QueryPlugin.Util.getString("ERR.015.001.0058",strName)); //$NON-NLS-1$ //$NON-NLS-2$
      }
      }
  }
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.