Package com.bacoder.parser.java.api

Examples of com.bacoder.parser.java.api.CatchClause


    tryStatement.setCatchClauses(transform(context, CatchClauseContext.class,
        new Function<CatchClauseContext, CatchClause>() {
          @Override
          public CatchClause apply(CatchClauseContext context) {
            CatchClause catchClause = createNode(context, CatchClause.class);

            setModifiers(context, catchClause);

            CatchTypeContext catchTypeContext = getChild(context, CatchTypeContext.class);
            if (catchTypeContext != null) {
              catchClause.setExceptions(transform(catchTypeContext, QualifiedNameContext.class,
                  new Function<QualifiedNameContext, QualifiedName>() {
                    @Override
                    public QualifiedName apply(QualifiedNameContext context) {
                      return getAdapter(QualifiedNameAdapter.class).adapt(context);
                    }
                  }));
            }

            TerminalNode identifierNode = getTerminalNode(context, JavaParser.Identifier);
            if (identifierNode != null) {
              catchClause.setVariable(getAdapter(IdentifierAdapter.class).adapt(identifierNode));
            }

            BlockContext blockContext = getChild(context, BlockContext.class);
            if (blockContext != null) {
              catchClause.setBody(getAdapter(BlockAdapter.class).adapt(blockContext));
            }

            return catchClause;
          }
        }));
View Full Code Here

TOP

Related Classes of com.bacoder.parser.java.api.CatchClause

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.