Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
License Agreement. Rich Faces - Natural Ajax for Java Server Faces (JSF) Copyright (C) 2007 Exadel, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
 
 package org.ajax4jsf.templatecompiler.elements.html;
 
 import java.net.URL;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 

Author(s):
yukhovich
Maksim Kaszynski
 
 public class HTMLTags {
 
 	
 	private static final String HTML_SCHEMA = "META-INF/schema/html/xhtml1-transitional.dtd";
 	
 	private static final URL HTML_DTD = HTMLTags.class.getClassLoader().getResource();
 	
 	@SuppressWarnings("unchecked")
 	public static Set<StringgetAttributes(String tagName) {
 		Set<Stringatrs = Collections.emptySet();
 		
 			DocumentDefinitionFactory.instance().getDocumentDefinition();
 		
 		if (dtd != null) {
 			Element element = dtd.getElement(tagName);
 
 			if (element != null) {
 				atrs = element.getAttributes().keySet();
 			}
 		}
 		
 		return atrs;
 		
 	}

Look for tags.bin, and compare with it

Parameters:
args
Throws:
java.lang.Exception
 
 	public static void main(String [] argsthrows Exception{
 		InputStream stream = HTMLTags.class.getClassLoader().getResourceAsStream("META-INF/templates/templatecompiler/tags.bin");
 		
 		ObjectInputStream stream2 = new ObjectInputStream(stream);
 		
 		@SuppressWarnings("unchecked")
 		Map<StringList<String>> m = 
 			(Map<StringList<String>>) stream2.readObject();
 		
 		Set<StringnewAttrs = new TreeSet<String>();
 		
 		Set<Entry<String,List<String>>> entrySet = m.entrySet();
 		for (Entry<StringList<String>> entry : entrySet) {
 			String element = entry.getKey();
 			
 			Set<Stringattributes = HTMLTags.getAttributes(element);
 			List<StringattributeList = entry.getValue();
 			
 			if (attributeList != null && attributes != null) {
 				attributes.removeAll(attributeList);
 			}
 			newAttrs.addAll(attributes);
 			
 			..println(element + attributes);
		}
		..println(newAttrs);
	}
New to GrepCode? Check out our FAQ X