Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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));
    }
}