private void parseCapabilityTag(Element capability) { // Get the event type. EventType eventType = EventType.valueOfIgnoreCase( capability.getAttributeValue(CAPABILITY_NAME_ATTRIBUTE)); if (eventType == EventType.UNKNOWN) { return; } // Parse comma separated "context" attribute. List<Context> contexts; String contextsString = capability.getAttributeValue(CAPABILITY_CONTEXT_ATTRIBUTE); if (contextsString != null && !contextsString.isEmpty()) { try { contexts = Lists.newArrayList(); for (String context : contextsString.split(",")) { contexts.add(Context.valueOfIgnoreCase(context)); } } catch (IllegalArgumentException e) { contexts = Capability.DEFAULT_CONTEXT; } } else { contexts = Capability.DEFAULT_CONTEXT; } // Parse optional "filter" attribute. String filter = capability.getAttributeValue(CAPABILITY_FILTER_ATTRIBUTE); if (filter == null || filter.isEmpty()) { filter = ""; } this.capabilities.put(eventType, new Capability(eventType, contexts, filter)); }
EventType type = EventType.valueOfIgnoreCase(eventTypeString); if (type == EventType.UNKNOWN) { throw new EventSerializationException("Trying to deserialize event JSON with unknown " +