Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.openfuxml.addon.wiki.emitter;
 
 
 
public class GlosstermEmitter extends SimpleMappingEmitter {
	private StringBuilder acronym = new StringBuilder();
	{
		super(ef,"glossterm");
	}
	protected void localContent(XMLStreamWriter writerchar[] chint startint lengththrows XMLStreamException {
		if (length > 0) {
			.append(chstartlength);
		}
		super.localContent(writerchstartlength);
	}
	public boolean localEnd(XMLStreamWriter writerString htmlElementNamethrows XMLStreamException {
		HashMap<StringStringacronyms = new HashMap<StringString>();
		if (.length() > 0) {
			String acronym = this..toString().trim();
			if (acronym.length() > 0) {
				String previousTitle = acronyms.put(acronym);
				if (previousTitle != null) {
					if ( == null || previousTitle.length() > .length()) {
						acronyms.put(acronympreviousTitle);
					}
				}
			}
		}
		return super.localEnd(writerhtmlElementName);
	}
	public boolean localStart(XMLStreamWriter writerString htmlElementNameAttributes attsthrows XMLStreamException {
		if (htmlElementName.equals("acronym")) {
			 = atts.getValue("title");
		}
		return super.localStart(writerhtmlElementNameatts);
	}
New to GrepCode? Check out our FAQ X