/* (non-Javadoc)
@see org.apereo.portal.character.stream.FilteringCharacterEventReader#filterEvent(org.apereo.portal.character.stream.events.CharacterEvent, boolean)
199284
@Override
    protected CharacterEvent filterEvent(CharacterEvent event, boolean peek) {
        if (event.getEventType() == CharacterEventTypes.JSON_LAYOUT) {
            inLayout = !inLayout;
            return null;
        }

        if (inLayout) {
            return event;
        }

        return null;
    }
283136
@Override
	public void processEvent(SystemEvent event) throws AbortProcessingException {
		if (!FacesContext.getCurrentInstance().isPostback()) {
			// if (!(getParent() instanceof Column)) {
			insertLabelBeforeThisInputField();
			insertMessageBehindThisInputField();
		}
		// }
	}
335484
protected void process(BufferedReader bufferedReader) throws IOException {
        Matcher eventMatcher;
        Matcher exceptionMatcher;
        String line;
        while ((line = bufferedReader.readLine()) != null) {
            //skip empty line entries
            eventMatcher = regexpPattern.matcher(line);
            if (line.trim().equals("")) {continue;}
            exceptionMatcher = exceptionPattern.matcher(line);
            if (eventMatcher.matches()) {
                //build an event from the previous match (held in current map)
                LoggingEvent event = buildEvent();
                if (event != null) {
                    if (passesExpression(event)) {
                        doPost(event);
                    }
                }
                currentMap.putAll(processEvent(eventMatcher.toMatchResult()));
            } else if (exceptionMatcher.matches()) {
                //an exception line
                additionalLines.add(line);
            } else {
                //neither...either post an event with the line or append as additional lines
                //if this was a logging event with multiple lines, each line will show up as its own event instead of being
                //appended as multiple lines on the same event..
                //choice is to have each non-matching line show up as its own line, or append them all to a previous event
                if (appendNonMatches) {
                    //hold on to the previous time, so we can do our best to preserve time-based ordering if the event is a non-match
                    String lastTime = (String)currentMap.get(TIMESTAMP);
                    //build an event from the previous match (held in current map)
                    if (currentMap.size() > 0) {
                        LoggingEvent event = buildEvent();
                        if (event != null) {
                            if (passesExpression(event)) {
                              doPost(event);
                            }
                        }
                    }
                    if (lastTime != null) {
                        currentMap.put(TIMESTAMP, lastTime);
                    }
                    currentMap.put(MESSAGE, line);
                } else {
                    additionalLines.add(line);
                }
            }
        }

        //process last event if one exists
        LoggingEvent event = buildEvent();
        if (event != null) {
            if (passesExpression(event)) {
                doPost(event);
            }
        }
    }
811441
@Override
    public boolean matches(Object otherEvent)
    {
        if (otherEvent == this) {
            return true;
        }

        boolean isMatching = false;

        if (this.getClass().isAssignableFrom(otherEvent.getClass())) {
            isMatching = getEventFilter().matches(((AbstractFilterableEvent) otherEvent).getEventFilter());
        }

        return isMatching;
    }
24444
@Beta
    public EventGridEvent[] deserializeEventGridEvents(final String requestContent, final SerializerAdapter<ObjectMapper> serializerAdapter) throws IOException {
        EventGridEvent[] eventGridEvents = serializerAdapter.<EventGridEvent[]>deserialize(requestContent, EventGridEvent[].class);
        for (EventGridEvent receivedEvent : eventGridEvents) {
            if (receivedEvent.data() == null) {
                continue;
            } else {
                final String eventType = receivedEvent.eventType();
                final Type eventDataType;
                if (SystemEventTypeMappings.containsMappingFor(eventType)) {
                    eventDataType = SystemEventTypeMappings.getMapping(eventType);
                } else if (containsCustomEventMappingFor(eventType)) {
                    eventDataType = getCustomEventMapping(eventType);
                } else {
                    eventDataType = null;
                }
                if (eventDataType != null) {
                    final String eventDataAsString = serializerAdapter.serializeRaw(receivedEvent.data());
                    final Object eventData = serializerAdapter.<Object>deserialize(eventDataAsString, eventDataType);
                    setEventData(receivedEvent, eventData);
                }
            }
        }
        return eventGridEvents;
    }
472426
@Override
    public String filter(String value, String previousValue){
        if(previousValue != null && value.length() > previousValue.length())
            return value;
        return value.equals("0") || value.equals("0.0") ? "" : value;
    }
1109750
void filterTree(String filter) {

        HierarchicalContainer container = (HierarchicalContainer)m_tree.getContainerDataSource();
        container.removeAllContainerFilters();
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(filter)) {
            final String lowerCaseFilter = filter.toLowerCase();
            container.addContainerFilter(new Filter() {

                private static final long serialVersionUID = 1L;

                public boolean appliesToProperty(Object propertyId) {

                    return true;
                }

                public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException {

                    CmsCategory cat = (CmsCategory)itemId;

                    return cat.getPath().toLowerCase().contains(lowerCaseFilter)
                        || ((cat.getTitle() != null) && cat.getTitle().toLowerCase().contains(lowerCaseFilter));
                }
            });
        }
    }
1076608
@EventBusListenerMethod(scope = EventScope.UI, filter = OnlyEventsFromDeploymentViewFilter.class)
    void onEvent(final RefreshDistributionTableByFilterEvent filterEvent) {
        UI.getCurrent().access(this::refreshFilter);
    }
118884
def eventFilter(self, object, event):
        
        if object == self._richTextLabel:
            if event.type() in (event.MouseButtonPress,
                                event.MouseMove,
                                event.MouseButtonRelease,
                                event.MouseButtonDblClick):
                event.ignore()
                return True
        return False
837295
private void processFilterAction() {
		if (!(chkFilter.isSelected())) {
			applyFilters(new ArrayList<>());
		}
		if (chkFilter.isSelected()) {
			if (txtFilter.getText().isEmpty()) {
				chkFilter.setSelected(false);
				applyFilters(new ArrayList<>());
				return;
			}
			try {
				List<TreeModelFilter<SQLPPTriplesMap>> filters = parseSearchString(txtFilter.getText());
				if (filters == null) {
					throw new Exception("Impossible to parse search string");
				}
				applyFilters(filters);
			} catch (Exception e) {
				LoggerFactory.getLogger(this.getClass()).debug(e.getMessage(), e);
				JOptionPane.showMessageDialog(this, e.getMessage());
			}
		}
	}
392700
@Override
    public boolean filter(Object data) {
        logger.entering(data);
        String[] keyValues = filterKeyValues.split(",");
        String tempKey = null;
        Field field;

        try {
            field = data.getClass().getDeclaredField(filterKeyName);
            field.setAccessible(true);
            for (String keyValue : keyValues) {
                tempKey = keyValue;
                if (field.get(data) != null && field.get(data).toString().trim().equals(keyValue)) {
                    logger.exiting(true);
                    return true;
                }
            }
        } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
            throw new DataProviderException("Row with key '" + tempKey + "' is not found for given filter key '"
                    + filterKeyName + "'", e);
        }
        logger.exiting(false);
        return false;
    }
1086094
@Override
    public void onApplicationEvent(final ApplicationEvent applicationEvent) {
        if (!(applicationEvent instanceof TenantAwareEvent)) {
            return;
        }

        final TenantAwareEvent event = (TenantAwareEvent) applicationEvent;

        collectRolloutEvent(event);
        // to dispatch too many events which are not interested on the UI
        if (!isEventProvided(event)) {
            LOG.trace("Event is not supported in the UI!!! Dropped event is {}", event);
            return;
        }
        offerEvent(event);
    }
501996
@Override
    public PipelineEventReader<XMLEventReader, XMLEvent> getEventReader(
            HttpServletRequest request, HttpServletResponse response) {
        final PipelineEventReader<XMLEventReader, XMLEvent> pipelineEventReader =
                this.wrappedComponent.getEventReader(request, response);

        final XMLEventReader eventReader = pipelineEventReader.getEventReader();
        final PortletRenderingXMLEventReader filteredEventReader =
                new PortletRenderingXMLEventReader(request, response, eventReader);

        final Map<String, String> outputProperties = pipelineEventReader.getOutputProperties();
        return new PipelineEventReaderImpl<XMLEventReader, XMLEvent>(
                filteredEventReader, outputProperties);
    }
172039
@Override
	public boolean acceptsEvent(String type, Object event, Function<String, String> resolver) {
		return false;
	}
695928
@Beta
    public boolean removeCustomEventMapping(final String eventType) {
        if (!containsCustomEventMappingFor(eventType)) {
            return false;
        } else {
            this.eventTypeToEventDataMapping.remove(canonicalizeEventType(eventType));
            return true;
        }
    }
1334684
public boolean audit(AnnotationAuditEvent annotationEvent) {
        List<AuditAnnotationFilter> filters = Context.getConfigContext().getAnnotationFilters();
        if (!filters.isEmpty()) {
            for (AuditAnnotationFilter filter : filters) {
                if (!filter.accepts(annotationEvent)) {
                    return false;
                }
            }
        }
        Context.getAuditStream().write(annotationEvent);
        return true;
    }
695814
private boolean filter(Event event) {
        for (EventFilter filter : eventFilters) {
            if (filter.filter(event)) {
                return true;
            }
        }
        return false;
    }