/** * Creates a new AllowEventsHeader based on the newly supplied event type * value. * * @param eventType - the new string containing the eventType value. * @throws ParseException which signals that an error has been reached * unexpectedly while parsing the eventType value. * @return the newly created AllowEventsHeader object. * @since v1.1 */ public AllowEventsHeader createAllowEventsHeader(String eventType) throws ParseException { if (eventType == null) throw new NullPointerException("null arg eventType"); AllowEvents allowEvents = new AllowEvents(); allowEvents.setEventType(eventType); return allowEvents; }
/** * Gets an Iterator of all the methods of the AllowEventsHeader. Returns an empty * * Iterator if no methods are defined in this AllowEvents Header. * * * * @return Iterator of String objects each identifing the methods of * * AllowEventsHeader. * * */ public ListIterator<String> getMethods() { ListIterator<AllowEvents> li = super.hlist.listIterator(); LinkedList<String> ll = new LinkedList<String> (); while (li.hasNext()) { AllowEvents allowEvents = (AllowEvents) li.next(); ll.add(allowEvents.getEventType()); } return ll.listIterator(); }
headerName(TokenTypes.ALLOW_EVENTS); AllowEvents allowEvents = new AllowEvents(); allowEvents.setHeaderName(SIPHeaderNames.ALLOW_EVENTS); allowEvents.setEventType(token.getTokenValue()); this.lexer.SPorHT(); allowEvents = new AllowEvents(); this.lexer.match(TokenTypes.ID); token = lexer.getNextToken(); allowEvents.setEventType(token.getTokenValue());
/** * Sets the methods supported defined by this AllowEventsHeader. * * * * @param methods - the Iterator of Strings defining the methods supported * * in this AllowEventsHeader * * @throws ParseException which signals that an error has been reached * * unexpectedly while parsing the Strings defining the methods supported. * * */ public void setMethods(List<String> methods) throws ParseException { ListIterator<String> it = methods.listIterator(); while (it.hasNext()) { AllowEvents allowEvents = new AllowEvents(); allowEvents.setEventType((String) it.next()); this.add(allowEvents); } } }
headerName(TokenTypes.ALLOW_EVENTS); AllowEvents allowEvents = new AllowEvents(); this.lexer.match(TokenTypes.ID); Token token = lexer.getNextToken(); allowEvents.setEventType(token.getTokenValue()); this.lexer.SPorHT(); allowEvents = new AllowEvents(); this.lexer.match(TokenTypes.ID); token = lexer.getNextToken(); allowEvents.setEventType(token.getTokenValue());