Java Code Examples for com.sun.xml.internal.xsom.XSSimpleType#getName()

The following examples show how to use com.sun.xml.internal.xsom.XSSimpleType#getName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SimpleTypeBuilder.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the given simple type can be mapped to a
 * type-safe enum class.
 *
 * <p>
 * JAXB spec places a restrictrion as to what type can be
 * mapped to a type-safe enum. This method enforces this
 * constraint.
 */
public static boolean canBeMappedToTypeSafeEnum( XSSimpleType type ) {
    do {
        if( WellKnownNamespace.XML_SCHEMA.equals(type.getTargetNamespace()) ) {
            // type must be derived from one of these types
            String localName = type.getName();
            if( localName!=null ) {
                if( localName.equals("anySimpleType") )
                    return false;   // catch all case
                if( localName.equals("ID") || localName.equals("IDREF") )
                    return false;   // not ID/IDREF

                // other allowed list
                if( builtinTypeSafeEnumCapableTypes.contains(localName) )
                    return true;
            }
        }

        type = type.getSimpleBaseType();
    } while( type!=null );

    return false;
}
 
Example 2
Source File: SimpleTypeBuilder.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the given simple type can be mapped to a
 * type-safe enum class.
 *
 * <p>
 * JAXB spec places a restrictrion as to what type can be
 * mapped to a type-safe enum. This method enforces this
 * constraint.
 */
public static boolean canBeMappedToTypeSafeEnum( XSSimpleType type ) {
    do {
        if( WellKnownNamespace.XML_SCHEMA.equals(type.getTargetNamespace()) ) {
            // type must be derived from one of these types
            String localName = type.getName();
            if( localName!=null ) {
                if( localName.equals("anySimpleType") )
                    return false;   // catch all case
                if( localName.equals("ID") || localName.equals("IDREF") )
                    return false;   // not ID/IDREF

                // other allowed list
                if( builtinTypeSafeEnumCapableTypes.contains(localName) )
                    return true;
            }
        }

        type = type.getSimpleBaseType();
    } while( type!=null );

    return false;
}
 
Example 3
Source File: SimpleTypeBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the given simple type can be mapped to a
 * type-safe enum class.
 *
 * <p>
 * JAXB spec places a restrictrion as to what type can be
 * mapped to a type-safe enum. This method enforces this
 * constraint.
 */
public static boolean canBeMappedToTypeSafeEnum( XSSimpleType type ) {
    do {
        if( WellKnownNamespace.XML_SCHEMA.equals(type.getTargetNamespace()) ) {
            // type must be derived from one of these types
            String localName = type.getName();
            if( localName!=null ) {
                if( localName.equals("anySimpleType") )
                    return false;   // catch all case
                if( localName.equals("ID") || localName.equals("IDREF") )
                    return false;   // not ID/IDREF

                // other allowed list
                if( builtinTypeSafeEnumCapableTypes.contains(localName) )
                    return true;
            }
        }

        type = type.getSimpleBaseType();
    } while( type!=null );

    return false;
}
 
Example 4
Source File: SimpleTypeBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the given simple type can be mapped to a
 * type-safe enum class.
 *
 * <p>
 * JAXB spec places a restrictrion as to what type can be
 * mapped to a type-safe enum. This method enforces this
 * constraint.
 */
public static boolean canBeMappedToTypeSafeEnum( XSSimpleType type ) {
    do {
        if( WellKnownNamespace.XML_SCHEMA.equals(type.getTargetNamespace()) ) {
            // type must be derived from one of these types
            String localName = type.getName();
            if( localName!=null ) {
                if( localName.equals("anySimpleType") )
                    return false;   // catch all case
                if( localName.equals("ID") || localName.equals("IDREF") )
                    return false;   // not ID/IDREF

                // other allowed list
                if( builtinTypeSafeEnumCapableTypes.contains(localName) )
                    return true;
            }
        }

        type = type.getSimpleBaseType();
    } while( type!=null );

    return false;
}
 
Example 5
Source File: SimpleTypeBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the given simple type can be mapped to a
 * type-safe enum class.
 *
 * <p>
 * JAXB spec places a restrictrion as to what type can be
 * mapped to a type-safe enum. This method enforces this
 * constraint.
 */
public static boolean canBeMappedToTypeSafeEnum( XSSimpleType type ) {
    do {
        if( WellKnownNamespace.XML_SCHEMA.equals(type.getTargetNamespace()) ) {
            // type must be derived from one of these types
            String localName = type.getName();
            if( localName!=null ) {
                if( localName.equals("anySimpleType") )
                    return false;   // catch all case
                if( localName.equals("ID") || localName.equals("IDREF") )
                    return false;   // not ID/IDREF

                // other allowed list
                if( builtinTypeSafeEnumCapableTypes.contains(localName) )
                    return true;
            }
        }

        type = type.getSimpleBaseType();
    } while( type!=null );

    return false;
}
 
Example 6
Source File: SimpleTypeBuilder.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the given simple type can be mapped to a
 * type-safe enum class.
 *
 * <p>
 * JAXB spec places a restrictrion as to what type can be
 * mapped to a type-safe enum. This method enforces this
 * constraint.
 */
public static boolean canBeMappedToTypeSafeEnum( XSSimpleType type ) {
    do {
        if( WellKnownNamespace.XML_SCHEMA.equals(type.getTargetNamespace()) ) {
            // type must be derived from one of these types
            String localName = type.getName();
            if( localName!=null ) {
                if( localName.equals("anySimpleType") )
                    return false;   // catch all case
                if( localName.equals("ID") || localName.equals("IDREF") )
                    return false;   // not ID/IDREF

                // other allowed list
                if( builtinTypeSafeEnumCapableTypes.contains(localName) )
                    return true;
            }
        }

        type = type.getSimpleBaseType();
    } while( type!=null );

    return false;
}
 
Example 7
Source File: SimpleTypeBuilder.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the given simple type can be mapped to a
 * type-safe enum class.
 *
 * <p>
 * JAXB spec places a restrictrion as to what type can be
 * mapped to a type-safe enum. This method enforces this
 * constraint.
 */
public static boolean canBeMappedToTypeSafeEnum( XSSimpleType type ) {
    do {
        if( WellKnownNamespace.XML_SCHEMA.equals(type.getTargetNamespace()) ) {
            // type must be derived from one of these types
            String localName = type.getName();
            if( localName!=null ) {
                if( localName.equals("anySimpleType") )
                    return false;   // catch all case
                if( localName.equals("ID") || localName.equals("IDREF") )
                    return false;   // not ID/IDREF

                // other allowed list
                if( builtinTypeSafeEnumCapableTypes.contains(localName) )
                    return true;
            }
        }

        type = type.getSimpleBaseType();
    } while( type!=null );

    return false;
}
 
Example 8
Source File: SimpleTypeBuilder.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the given simple type can be mapped to a
 * type-safe enum class.
 *
 * <p>
 * JAXB spec places a restrictrion as to what type can be
 * mapped to a type-safe enum. This method enforces this
 * constraint.
 */
public static boolean canBeMappedToTypeSafeEnum( XSSimpleType type ) {
    do {
        if( WellKnownNamespace.XML_SCHEMA.equals(type.getTargetNamespace()) ) {
            // type must be derived from one of these types
            String localName = type.getName();
            if( localName!=null ) {
                if( localName.equals("anySimpleType") )
                    return false;   // catch all case
                if( localName.equals("ID") || localName.equals("IDREF") )
                    return false;   // not ID/IDREF

                // other allowed list
                if( builtinTypeSafeEnumCapableTypes.contains(localName) )
                    return true;
            }
        }

        type = type.getSimpleBaseType();
    } while( type!=null );

    return false;
}