public void topLevelAnnotation(ParsedElementAnnotation ea) throws BuildException { // Harshit : Fixed issue in handling of annotations if (additionalElementAnnotations==null) { additionalElementAnnotations = new ArrayList<Element>(); } additionalElementAnnotations.add(((ElementWrapper)ea).element); if (grammar.annotation==null) { grammar.annotation = new DAnnotation(); } grammar.annotation.contents.addAll(additionalElementAnnotations); }
/** * Gets the attribute of a given name. * * @param nsUri * can be empty but must not be null. * @return * null if no such attribute is found. */ public Attribute getAttribute( String nsUri, String localName ) { return getAttribute(new QName(nsUri,localName)); }
protected void on(DAnnotation ann) { if (ann == DAnnotation.EMPTY) return; for (DAnnotation.Attribute attr : ann.getAttributes().values()) { attr(attr.getPrefix(), attr.getNs(), attr.getLocalName(), attr.getValue()); } for (Element elem : ann.getChildren()) { try { newLine(); indent(); print(elem); } catch (XMLStreamException e) { throw new XMLWriterException(e); } } }
protected void on(DAnnotation ann) { if (ann == DAnnotation.EMPTY) return; for (DAnnotation.Attribute attr : ann.getAttributes().values()) { attr(attr.getPrefix(), attr.getNs(), attr.getLocalName(), attr.getValue()); } for (Element elem : ann.getChildren()) { try { newLine(); indent(); print(elem); } catch (XMLStreamException e) { throw new XMLWriterException(e); } } }
/** * Gets the attribute of a given name. * * @param nsUri * can be empty but must not be null. * @return * null if no such attribute is found. */ public Attribute getAttribute( String nsUri, String localName ) { return getAttribute(new QName(nsUri,localName)); }
public ParsedPattern endGrammar(Location loc, Annotations anno) throws BuildException { if(anno!=null) grammar.annotation = ((Annotation)anno).getResult(); if(additionalElementAnnotations!=null) { if(grammar.annotation==null) grammar.annotation = new DAnnotation(); grammar.annotation.contents.addAll(additionalElementAnnotations); } return grammar; }