public void processEndElement() throws ParseException { if (title == null) { throw new ParseException( CoreErrorDomain.ERR.workspaceTitleRequired); } } }
@Override public void processEndElement() throws ParseException { if (linkRequired && href == null) { throw new ParseException( CoreErrorDomain.ERR.missingHrefAttribute); } titleLang = xmlLang; // Allow undefined content. } }
@Override public void processEndElement() throws ParseException { if (name == null) { throw new ParseException("apps:property/@name is required."); } if (val == null) { throw new ParseException("apps:property/@value is required."); } } }
private int parseInteger(String value) throws ParseException { try { return Integer.parseInt(value); } catch (NumberFormatException nfe) { throw new ParseException( "Invalid size value '" + value + "'", nfe); } } };
public void processEndElement() throws ParseException { if (workspaces.size() == 0) { throw new ParseException( CoreErrorDomain.ERR.workspaceRequired); } } }
public void processEndElement() throws ParseException { if (workspaces.size() == 0) { throw new ParseException( CoreErrorDomain.ERR.workspaceRequired); } } }
/** * Called to process this element when the closing tag is encountered. * The default implementation refuses to accept text() content, unless * the handler is configured to accept unrecognized XML with mixed content. */ public void processEndElement() throws ParseException { if (value != null && !value.trim().equals("") && !mixedContent) { throw new ParseException( CoreErrorDomain.ERR.textNotAllowed); } }
@Override public void processEndElement() throws ParseException { super.processEndElement(); if (title == null) { throw new ParseException( CoreErrorDomain.ERR.collectionTitleRequired); } }
@Override public void processEndElement() throws ParseException { if (feedLink == null) { throw new ParseException( CoreErrorDomain.ERR.commentsFeedLinkRequired); } super.processEndElement(); }
@Override public void processEndElement() throws ParseException { if ((days == null ? 0 : 1) + (hours == null ? 0 : 1) + (minutes == null ? 0 : 1) + (absoluteTime == null ? 0 : 1) > 1) { throw new ParseException( CoreErrorDomain.ERR.tooManyAttributes); } super.processEndElement(); } }
@Override public void processEndElement() throws ParseException { if ((days == null ? 0 : 1) + (hours == null ? 0 : 1) + (minutes == null ? 0 : 1) + (absoluteTime == null ? 0 : 1) > 1) { throw new ParseException( CoreErrorDomain.ERR.tooManyAttributes); } super.processEndElement(); } }
@Override public DateTime convertValue(String value, Class<? extends DateTime> datatype) throws ParseException { try { return DateTime.parseDateTimeChoice(value); } catch (NumberFormatException e) { throw new ParseException( CoreErrorDomain.ERR.invalidDatetime, e); } } }
/** Parses the value as an RFC 822 date/time. */ public static DateTime parseRfc822(String str) throws ParseException { Date date; synchronized (dateTimeFormat822) { try { date = dateTimeFormat822.parse(str); } catch (java.text.ParseException e) { throw new ParseException(e); } } return new DateTime(date); }
@Override public void processEndElement() throws ParseException { if (limit == null) { throw new ParseException("apps:quota/@limit is required."); } super.processEndElement(); } }
@Override public void processEndElement() throws ParseException { super.processEndElement(); if (title == null) { throw new ParseException( CoreErrorDomain.ERR.collectionTitleRequired); } }
@Override public void processEndElement() throws ParseException { if ((days == null ? 0 : 1) + (hours == null ? 0 : 1) + (minutes == null ? 0 : 1) + (absoluteTime == null ? 0 : 1) > 1) { throw new ParseException( CoreErrorDomain.ERR.tooManyAttributes); } super.processEndElement(); } }
@Override public DateTime convertValue(String value, Class<? extends DateTime> datatype) throws ParseException { try { return DateTime.parseDateTimeChoice(value); } catch (NumberFormatException e) { throw new ParseException( CoreErrorDomain.ERR.invalidDatetime, e); } } }
@Override protected void consumeAttributes(AttributeHelper helper) throws ParseException { super.consumeAttributes(helper); try { countHint = Integer.parseInt(helper.consumeContent(true)); } catch (NumberFormatException e) { throw new ParseException("CountHint should be an integer"); } } }
@Override protected void consumeAttributes(AttributeHelper helper) throws ParseException { super.consumeAttributes(helper); gender = Value.fromId(helper.consumeContent(true)); if (gender == null) { // It is necessarily null because the value is invalid, since // consumeContent(true) requires something to be there. throw new ParseException("Unknown gender. It should be m or f."); } } }
@Override protected void consumeAttributes(AttributeHelper helper) throws ParseException { super.consumeAttributes(helper); gender = Value.fromId(helper.consumeContent(true)); if (gender == null) { // It is necessarily null because the value is invalid, since // consumeContent(true) requires something to be there. throw new ParseException("Unknown gender. It should be m or f."); } } }