/** * Add an extension. * @see ExtensionPoint#addExtension(Extension) */ public void addExtension(Extension extension) { extPoint.addExtension(extension); }
/** * Add a repeating extension. * @see ExtensionPoint#addRepeatingExtension(Extension) */ public void addRepeatingExtension(Extension extension) { extPoint.addRepeatingExtension(extension); }
/** * Gets the value of the tag {@code <batch:status>}. * * @param extPoint the extension point to get the status from * @return the object corresponding to the tag or null */ public static BatchStatus getBatchStatus(ExtensionPoint extPoint) { return extPoint.getExtension(BatchStatus.class); }
String localName, Attributes attrs) throws ParseException, IOException { ExtensionDescription extDescription = getExtensionDescription(extProfile, extPoint, namespaceUri, localName); if (extDescription == null) { extension = getExtension(extClass); extension = createExtensionInstance(extClass); } else { needsAdd = false; addRepeatingExtension(extension, extClass); } else { boolean added = addExtension(extension, extClass); if (!added) { ParseException pe = new ParseException(
@Override protected void visitChildren(ExtensionVisitor ev) throws StoppedException { if (feedLink != null) { visitChild(ev, feedLink); } super.visitChildren(ev); }
@Override protected void generate(XmlWriter w, ExtensionProfile p, XmlNamespace namespace, String localName, List<XmlWriter.Attribute> attrs, AttributeGenerator generator) throws IOException { // validate if (generator.getContent() != null) { throw new IllegalStateException( "No content allowed on an extension point"); } try { ExtensionManifest profManifest = p.getManifest(this.getClass()); if (profManifest != null) { checkRequiredExtensions(profManifest); } } catch (ParseException e) { throw new IllegalStateException(e.getMessage()); } // generate XML generateStartElement(w, namespace, localName, attrs, null); generateExtensions(w, p); w.endElement(namespace, localName); }
@Override public void declareExtensions(ExtensionProfile extProfile) { super.declareExtensions(extProfile); MediaRssNamespace.declareAll(extProfile); }
public void setKeywords(MediaKeywords keywords) { MediaGroup group = extPoint.getExtension(MediaGroup.class); if (group == null) { group = new MediaGroup(); extPoint.addExtension(group); } group.setKeywords(keywords); }
@Override public void processEndElement() throws ParseException { super.processEndElement(); if (this.extManifest != null) { 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); } } } } }
String localName, Attributes attrs) throws ParseException, IOException { ExtensionDescription extDescription = getExtensionDescription(extProfile, extPoint, namespaceUri, localName); if (extDescription == null) { extension = getExtension(extClass); extension = createExtensionInstance(extClass); } else { needsAdd = false; addRepeatingExtension(extension, extClass); } else { boolean added = addExtension(extension, extClass); if (!added) { ParseException pe = new ParseException(
@Override protected void visitChildren(ExtensionVisitor ev) throws ExtensionVisitor.StoppedException { // Add nested workspaces to the visitor pattern for (Workspace workspace : workspaces) { this.visitChild(ev, workspace); } super.visitChildren(ev); }
@Override protected void generate(XmlWriter w, ExtensionProfile p, XmlNamespace namespace, String localName, List<XmlWriter.Attribute> attrs, AttributeGenerator generator) throws IOException { // validate if (generator.getContent() != null) { throw new IllegalStateException( "No content allowed on an extension point"); } try { ExtensionManifest profManifest = p.getManifest(this.getClass()); if (profManifest != null) { checkRequiredExtensions(profManifest); } } catch (ParseException e) { throw new IllegalStateException(e.getMessage()); } // generate XML generateStartElement(w, namespace, localName, attrs, null); generateExtensions(w, p); w.endElement(namespace, localName); }
@Override public void declareExtensions(ExtensionProfile extProfile) { super.declareExtensions(extProfile); MediaRssNamespace.declareAll(extProfile); }
public void setKeywords(MediaKeywords keywords) { MediaGroup group = extPoint.getExtension(MediaGroup.class); if (group == null) { group = new MediaGroup(); extPoint.addExtension(group); } group.setKeywords(keywords); }
@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); } } } } }
String localName, Attributes attrs) throws ParseException, IOException { ExtensionDescription extDescription = getExtensionDescription(extProfile, extPoint, namespaceUri, localName); if (extDescription == null) { extension = getExtension(extClass); extension = createExtensionInstance(extClass); } else { needsAdd = false; addRepeatingExtension(extension, extClass); } else { boolean added = addExtension(extension, extClass); if (!added) { ParseException pe = new ParseException(
@Override protected void visitChildren(ExtensionVisitor ev) throws StoppedException { if (entryLink != null) { visitChild(ev, entryLink); } super.visitChildren(ev); }
@Override protected void generate(XmlWriter w, ExtensionProfile p, XmlNamespace namespace, String localName, List<XmlWriter.Attribute> attrs, AttributeGenerator generator) throws IOException { // validate if (generator.getContent() != null) { throw new IllegalStateException( "No content allowed on an extension point"); } try { ExtensionManifest profManifest = p.getManifest(this.getClass()); if (profManifest != null) { checkRequiredExtensions(profManifest); } } catch (ParseException e) { throw new IllegalStateException(e.getMessage()); } // generate XML generateStartElement(w, namespace, localName, attrs, null); generateExtensions(w, p); w.endElement(namespace, localName); }
@Override public void declareExtensions(ExtensionProfile extProfile) { // Declare the gml:pos extension. extProfile.declare(GmlPoint.class, GmlPos.getDefaultDescription(false)); super.declareExtensions(extProfile); }
/** * Get an extension by class. * @see ExtensionPoint#getExtension(Class) */ protected <T extends Extension> T getExtension(Class<T> extClass) { return extPoint.getExtension(extClass); }