Java tutorial
//package com.java2s; import java.util.HashSet; public class Main { private static HashSet<Class<?>> supportedAttrTypes = new HashSet<Class<?>>(); /** * Determines whether specified type is supported as attributes data or for text-based * node property. * @param type Type that needs to be checked. * @return true if and only if type is supported as attributed type. */ public static boolean isSupportedAttributeClass(Class<?> type) { if (type == null) throw new NullPointerException("Type can not be null."); if (type.isPrimitive()) return true; return (supportedAttrTypes.contains(type)); } }