Package org.netbeans.modules.php.twig.editor.parsing

Examples of org.netbeans.modules.php.twig.editor.parsing.TwigParserResult$Error


    Error handleGenericException(Exception ex, HttpServletRequest request, HttpServletResponse response) {
        String errorId = LoggingUtil.generateErrorId();
        String errorMessage = generateLogErrorMessage(errorId) + " - Processing error";
        log.error(errorMessage, ex);

        Error error = new Error();
        error.setHttpStatusCode("500");
        error.setDeveloperMessage(messageSource.getMessage("api.genericException.developerMessage", null, request.getLocale()));
        error.setUserMessage(messageSource.getMessage("api.genericException.userMessage", null, request.getLocale()));
        error.setMoreInfo("support@knappsack.com");
        error.setErrorId(errorId);

        response.setStatus(500);

        return error;
    }
View Full Code Here


    Error handleEntityNotFoundException(Exception ex, HttpServletRequest request, HttpServletResponse response) {
        String errorId = LoggingUtil.generateErrorId();
        String errorMessage = generateLogErrorMessage(errorId) + " - No entity found";
        log.error(errorMessage, ex);

        Error error = new Error();
        error.setHttpStatusCode("400");
        error.setDeveloperMessage(messageSource.getMessage("api.entityNotFoundException.developerMessage=", null, request.getLocale()));
        error.setUserMessage(messageSource.getMessage("api.entityNotFoundException.userMessage", null, request.getLocale()));
        error.setMoreInfo("support@knappsack.com");
        error.setErrorId(errorId);

        response.setStatus(400);

        return error;
    }
View Full Code Here

    Error handleAccessDeniedException(AccessDeniedException ex, HttpServletRequest request, HttpServletResponse response) {
        String errorId = LoggingUtil.generateErrorId();
        String errorMessage = generateLogErrorMessage(errorId) + " - Access Denied";
        log.error(errorMessage, ex);

        Error error = new Error();
        error.setHttpStatusCode("403");
        error.setDeveloperMessage(messageSource.getMessage("api.accessDenied.developerMessage", null, request.getLocale()));
        error.setUserMessage(messageSource.getMessage("api.accessDenied.userMessage", null, request.getLocale()));
        error.setMoreInfo("support@knappsack.com");
        error.setErrorId(errorId);

        response.setStatus(403);

        return error;
    }
View Full Code Here

                errorId = (String) entry.getValue();
                errorCode = (String) entry.getValue();
              }
            }

                                                Error err = this._errors.get(errorCode);
                                                if (err == null){
                                                    err = Bpmn2Factory.eINSTANCE.createError();
                                                    err.setId(errorId);
                                                    err.setErrorCode(errorCode);
                                                    this._errors.put(errorCode, err);
                                                }
                                               
            toAddErrors.add(err);
            ((ErrorEventDefinition) ed).setErrorRef(err);
View Full Code Here

                                errorId = (String) entry.getValue();
                                errorCode = (String) entry.getValue();
                            }
                        }

                        Error err = this._errors.get(errorCode);
                        if (err == null){
                            err = Bpmn2Factory.eINSTANCE.createError();
                            err.setId(errorId);
                            err.setErrorCode(errorCode);
                            this._errors.put(errorCode, err);
                        }

                        toAddErrors.add(err);
                        ((ErrorEventDefinition) ed).setErrorRef(err);
View Full Code Here

                                                errorId = (String) entry.getValue();
                                                errorCode = (String) entry.getValue();
                                        }
                                }

                                Error err = this._errors.get(errorCode);
                                if (err == null){
                                    err = Bpmn2Factory.eINSTANCE.createError();
                                    err.setId(errorId);
                                    err.setErrorCode(errorCode);
                                    this._errors.put(errorCode, err);
                                }

                                toAddErrors.add(err);
                                ((ErrorEventDefinition) ed).setErrorRef(err);
View Full Code Here

                                errorId = (String) entry.getValue();
                                errorCode = (String) entry.getValue();
                            }
                        }

                        Error err = this._errors.get(errorCode);
                        if (err == null){
                            err = Bpmn2Factory.eINSTANCE.createError();
                            err.setId(errorId);
                            err.setErrorCode(errorCode);
                            this._errors.put(errorCode, err);
                        }

                        toAddErrors.add(err);
                        ((ErrorEventDefinition) ed).setErrorRef(err);
View Full Code Here

public class TwigStructureScanner implements StructureScanner {

    @Override
    public List<? extends StructureItem> scan( ParserResult info ) {
        TwigParserResult result = (TwigParserResult)info;
        List<TwigParserResult.Block> blocks = new ArrayList<TwigParserResult.Block>();
        List<TwigStructureItem> items = new ArrayList<TwigStructureItem>();
       
        for ( TwigParserResult.Block item : result.getBlocks() ) {
            if ( CharSequenceUtilities.equals( item.getDescription(), "block" ) || CharSequenceUtilities.equals( item.getDescription(), "*inline-block" ) ) {
                blocks.add( item );
            }
        }
       
        boolean isTopLevel = false;
       
        for ( TwigParserResult.Block item : blocks ) {
           
            isTopLevel = true;
           
            for ( TwigParserResult.Block check : blocks ) {
               
                if ( item.getOffset() > check.getOffset() &&
                     item.getOffset() + item.getLength() < check.getOffset() + check.getLength()
                ) {
                    isTopLevel = false;
                    break;
                }
               
            }
           
            if ( isTopLevel ) {
                items.add( new TwigStructureItem( result.getSnapshot(), item, blocks ) );
            }
           
        }

        return items;
View Full Code Here

    }

    @Override
    public Map<String, List<OffsetRange>> folds( ParserResult info ) {
       
        TwigParserResult result = (TwigParserResult)info;
        List<OffsetRange> ranges = new ArrayList<OffsetRange>();
       
        for ( TwigParserResult.Block block : result.getBlocks() ) {

            ranges.add( new OffsetRange(
                    block.getOffset(), block.getOffset() + block.getLength()
            ) );
           
View Full Code Here

TOP

Related Classes of org.netbeans.modules.php.twig.editor.parsing.TwigParserResult$Error

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.