Package antlr

Examples of antlr.SemanticException


  private Constructor resolveConstructor(String path) throws SemanticException {
    String importedClassName = getSessionFactoryHelper().getImportedClassName( path );
    String className = StringHelper.isEmpty( importedClassName ) ? path : importedClassName;
    if ( className == null ) {
      throw new SemanticException( "Unable to locate class [" + path + "]" );
    }
    try {
      Class holderClass = ReflectHelper.classForName( className );
      return ReflectHelper.getConstructor( holderClass, constructorArgumentTypes );
    }
View Full Code Here


  public void initialize() throws SemanticException {
    Node lhs = getLeftHandOperand();
    Node rhs = getRightHandOperand();
    if ( lhs == null ) {
      throw new SemanticException( "left-hand operand of a binary operator was null" );
    }
    if ( rhs == null ) {
      throw new SemanticException( "right-hand operand of a binary operator was null" );
    }

    Type lhType = ( lhs instanceof SqlNode ) ? ( ( SqlNode ) lhs ).getDataType() : null;
    Type rhType = ( rhs instanceof SqlNode ) ? ( ( SqlNode ) rhs ).getDataType() : null;
View Full Code Here

      throw new UnsupportedOperationException();
    }

    String propertyName = getOriginalText();
    if (!getDataType().isCollectionType()) {
      throw new SemanticException("Collection expected; [" + propertyName + "] does not refer to a collection property");
    }

    // TODO : most of below was taken verbatim from DotNode; should either delegate this logic or super-type it
    CollectionType type = (CollectionType) getDataType();
    String role = type.getRole();
View Full Code Here

   * nodes and setting their expected type, if possible.
   */
  public void initialize() throws SemanticException {
    Node lhs = getLeftHandOperand();
    if ( lhs == null ) {
      throw new SemanticException( "left-hand operand of a binary operator was null" );
    }
    Node rhs = getRightHandOperand();
    if ( rhs == null ) {
      throw new SemanticException( "right-hand operand of a binary operator was null" );
    }

    Type lhsType = extractDataType( lhs );
    Type rhsType = extractDataType( rhs );

View Full Code Here

    String text = queryableCollection.getTableName();
    AST ast = createFromElement( text );
    FromElement destination = ( FromElement ) ast;
    Type elementType = queryableCollection.getElementType();
    if ( elementType.isCollectionType() ) {
      throw new SemanticException( "Collections of collections are not supported!" );
    }
    destination.initializeCollection( fromClause, classAlias, tableAlias );
    destination.setType( JOIN_FRAGMENT );    // Tag this node as a JOIN.
    destination.setIncludeSubclasses( false )// Don't include subclasses in the join.
    destination.setCollectionJoin( true );    // This is a clollection join.
View Full Code Here

  }

  public void initialize() throws SemanticException {
    Node lhs = getLeftHandOperand();
    if ( lhs == null ) {
      throw new SemanticException( "left-hand operand of in operator was null" );
    }
    Node inList = getInList();
    if ( inList == null ) {
      throw new SemanticException( "right-hand operand of in operator was null" );
    }

    // for expected parameter type injection, we expect that the lhs represents
    // some form of property ref and that the children of the in-list represent
    // one-or-more params.
View Full Code Here

    return methodName;
  }

  private void collectionProperty(AST path, AST name) throws SemanticException {
    if ( path == null ) {
      throw new SemanticException( "Collection function " + name.getText() + " has no path!" );
    }

    SqlNode expr = ( SqlNode ) path;
    Type type = expr.getDataType();
    if ( log.isDebugEnabled() ) {
View Full Code Here

      prepareSelectColumns( selectColumns );
      setText( selectColumns[0] );
      setType( SqlTokenTypes.SQL_TOKEN );
    }
    else {
      throw new SemanticException(
          "Unexpected expression " + expr +
          " found for collection function " + propertyName
        );
    }
  }
View Full Code Here

      throw new UnsupportedOperationException();
    }

    String propertyName = getOriginalText();
    if (!getDataType().isCollectionType()) {
      throw new SemanticException("Collection expected; [" + propertyName + "] does not refer to a collection property");
    }

    // TODO : most of below was taken verbatim from DotNode; should either delegate this logic or super-type it
    CollectionType type = (CollectionType) getDataType();
    String role = type.getRole();
View Full Code Here

    this.inSelect = inSelect;
  }

  private void typeDiscriminator(AST path) throws SemanticException {
    if ( path == null ) {
      throw new SemanticException( "type() discriminator reference has no path!" );
    }

    FromReferenceNode pathAsFromReferenceNode = (FromReferenceNode) path;
    FromElement fromElement = pathAsFromReferenceNode.getFromElement();
    TypeDiscriminatorMetadata typeDiscriminatorMetadata = fromElement.getTypeDiscriminatorMetadata();
View Full Code Here

TOP

Related Classes of antlr.SemanticException

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.