@Override protected void consumeAttributes(AttributeHelper helper) throws ParseException { super.consumeAttributes(helper); playlistId = helper.consumeContent(true); } }
public void generate(XmlWriter w, ExtensionProfile p) throws IOException { // validate if (namespace == null) { String name = this.getClass().getName(); throw new IllegalStateException( "No @ExtensionDescription.Default annotation found on subclass " + name.substring(name.lastIndexOf('.') + 1)); } if (isStrictValidation()) { validate(); } // generate attributes AttributeGenerator generator = new AttributeGenerator(); putAttributes(generator); List<XmlWriter.Attribute> attrs = new ArrayList<XmlWriter.Attribute>(); generateAttributes(attrs, generator); // generate XML generate(w, p, namespace, localName, attrs, generator); }
@Override public XmlParser.ElementHandler getHandler(ExtensionProfile p, String namespace, String localName, Attributes attrs) throws ParseException { // for backwards compatibility set value to null first value = null; return super.getHandler(p, namespace, localName, attrs); }
@Override public void processEndElement() throws ParseException { /* don't call super.processEndElement() because it doesn't allow text() data */ // consume attributes if (helper != null) { helper.setContent(value); consumeAttributes(helper); } if (isStrictValidation()) { // validate try { validate(); } catch (IllegalStateException e) { throw new ParseException(e.getMessage(), e); } } } }
@Override protected void putAttributes(AttributeGenerator generator) { super.putAttributes(generator); generator.setContent(playlistId); }
@Override public void processEndElement() throws ParseException { /* don't call super.processEndElement() because it doesn't allow text() data */ // consume attributes if (helper != null) { helper.setContent(value); consumeAttributes(helper); helper.assertAllConsumed(); } // validate try { validate(); } catch (IllegalStateException e) { throw new ParseException(e.getMessage(), e); } } }
|| outputFormat.equals(AltFormat.APPLICATION_XML); if (disableValidation) { AbstractExtension.disableStrictValidation(); AbstractExtension.enableStrictValidation();
/** * Makes sure the item type is not null. * * {@inheritDoc} */ @Override protected void validate() { super.validate(); if (itemType == null) { throw new IllegalStateException("An item type should be set."); } }
@Override public void generate(XmlWriter w, ExtensionProfile p) throws IOException { // for backwards compatibility don't generate if no value if (value != null) { super.generate(w, p); } }
@Override protected void generateAttributes(List<Attribute> attrs, AttributeGenerator generator) { super.generateAttributes(attrs, generator); generator.setContent(value.getXmlName()); }
@Override public void processEndElement() throws ParseException { super.processEndElement(); if (this.extManifest != null && isStrictValidation()) { checkRequiredExtensions(this.extManifest); } // // Iterate through all contained Extension instances and enable them // to validate against the full ExtensionPoint state (including // sibling Extension instances). // for (Extension extension : nonRepeatingExtensionMap.values()) { if (extension instanceof ValidatingExtension) { ((ValidatingExtension) extension).validate(ExtensionPoint.this); } } for (List<Extension> extList : repeatingExtensionMap.values()) { for (Extension extension : extList) { if (extension instanceof ValidatingExtension) { ((ValidatingExtension) extension).validate(ExtensionPoint.this); } } } } }
@Override protected void putAttributes(AttributeGenerator generator) { super.putAttributes(generator); generator.setContent(playlistId); }
@Override public void processEndElement() throws ParseException { /* don't call super.processEndElement() because it doesn't allow text() data */ // consume attributes if (helper != null) { helper.setContent(value); consumeAttributes(helper); } if (isStrictValidation()) { // validate try { validate(); } catch (IllegalStateException e) { throw new ParseException(e.getMessage(), e); } } } }
|| outputFormat.equals(AltFormat.APPLICATION_XML); if (disableValidation) { AbstractExtension.disableStrictValidation(); AbstractExtension.enableStrictValidation();
/** * Makes sure the item type is not null. * * {@inheritDoc} */ @Override protected void validate() { super.validate(); if (itemType == null) { throw new IllegalStateException("An item type should be set."); } }
@Override public void generate(XmlWriter w, ExtensionProfile p) throws IOException { // for backwards compatibility don't generate if no value if (value != null) { super.generate(w, p); } }
@Override protected void generateAttributes(List<Attribute> attrs, AttributeGenerator generator) { super.generateAttributes(attrs, generator); generator.setContent(value.getXmlName()); }
@Override public void processEndElement() throws ParseException { super.processEndElement(); if (this.extManifest != null && isStrictValidation()) { checkRequiredExtensions(this.extManifest); } // // Iterate through all contained Extension instances and enable them // to validate against the full ExtensionPoint state (including // sibling Extension instances). // for (Extension extension : nonRepeatingExtensionMap.values()) { if (extension instanceof ValidatingExtension) { ((ValidatingExtension) extension).validate(ExtensionPoint.this); } } for (List<Extension> extList : repeatingExtensionMap.values()) { for (Extension extension : extList) { if (extension instanceof ValidatingExtension) { ((ValidatingExtension) extension).validate(ExtensionPoint.this); } } } } }
public void generate(XmlWriter w, ExtensionProfile p) throws IOException { // validate if (namespace == null) { String name = this.getClass().getName(); throw new IllegalStateException( "No @ExtensionDescription.Default annotation found on subclass " + name.substring(name.lastIndexOf('.') + 1)); } validate(); // generate attributes AttributeGenerator generator = new AttributeGenerator(); putAttributes(generator); List<XmlWriter.Attribute> attrs = new ArrayList<XmlWriter.Attribute>(); generateAttributes(attrs, generator); // generate XML generate(w, p, namespace, localName, attrs, generator); }
@Override protected void putAttributes(AttributeGenerator generator) { super.putAttributes(generator); generator.setContent(Integer.toString(position + 1)); }