Search in sources :

Example 1 with JavaClassImpl

use of org.eclipse.persistence.jaxb.javamodel.reflection.JavaClassImpl in project eclipselink by eclipse-ee4j.

the class Property method getGenericType.

private JavaClass getGenericType(JavaClass cls, int argument, Helper helper) {
    Collection typeArgs = cls.getActualTypeArguments();
    Object[] typeArgsArray = typeArgs.toArray();
    JavaClass genericType = null;
    if (cls.getPackageName().startsWith("java.")) {
        if (typeArgs.size() > argument) {
            Iterator iterator = typeArgs.iterator();
            for (int x = 0; x < argument; x++) {
                iterator.next();
            }
            return (JavaClass) iterator.next();
        } else {
            return helper.getJavaClass(Object.class);
        }
    } else {
        Map<String, JavaClass> variableToType = null;
        if (cls instanceof JavaClassImpl) {
            variableToType = new HashMap<String, JavaClass>();
            TypeVariable[] tvs = ((JavaClassImpl) cls).getJavaClass().getTypeParameters();
            if (tvs.length == typeArgsArray.length) {
                for (int x = 0; x < tvs.length; x++) {
                    variableToType.put(tvs[x].getName(), (JavaClass) typeArgsArray[x]);
                }
            }
        }
        Type genericTypeType = getGenericType(cls.getGenericSuperclass(), argument, variableToType);
        if (null == genericTypeType) {
            for (Type genericInterface : cls.getGenericInterfaces()) {
                genericTypeType = getGenericType(genericInterface, argument, variableToType);
                if (null != genericTypeType) {
                    break;
                }
            }
        }
        if (genericTypeType instanceof TypeVariable) {
            TypeVariable typeVariable = (TypeVariable) genericTypeType;
            JavaClass existing = variableToType.get(typeVariable.getName());
            if (existing != null) {
                return existing;
            } else {
                Type[] typeVariableBounds = typeVariable.getBounds();
                if (typeVariableBounds.length > 0) {
                    genericTypeType = typeVariableBounds[0];
                }
            }
        }
        if (genericTypeType instanceof Class) {
            genericType = helper.getJavaClass((Class) genericTypeType);
        }
        if (null == genericType || genericTypeType == Object.class) {
            if (typeArgs.size() > argument) {
                Iterator iterator = typeArgs.iterator();
                for (int x = 0; x < argument; x++) {
                    iterator.next();
                }
                genericType = (JavaClass) iterator.next();
            } else {
                genericType = helper.getJavaClass(Object.class);
            }
        }
        return genericType;
    }
}
Also used : JavaClassImpl(org.eclipse.persistence.jaxb.javamodel.reflection.JavaClassImpl) GenericArrayType(java.lang.reflect.GenericArrayType) ParameterizedType(java.lang.reflect.ParameterizedType) Type(java.lang.reflect.Type) TypeVariable(java.lang.reflect.TypeVariable) Iterator(java.util.Iterator) Collection(java.util.Collection)

Example 2 with JavaClassImpl

use of org.eclipse.persistence.jaxb.javamodel.reflection.JavaClassImpl in project eclipselink by eclipse-ee4j.

the class XMLProcessor method processXML.

/**
 * Process XmlBindings on a per package basis for a given
 * AnnotationsProcessor instance.
 */
public void processXML(AnnotationsProcessor annotationsProcessor, JavaModelInput jModelInput, TypeMappingInfo[] typeMappingInfos, JavaClass[] originalJavaClasses) {
    this.jModelInput = jModelInput;
    this.aProcessor = annotationsProcessor;
    this.aProcessor.setHasXmlBindings(true);
    Map<String, XmlEnum> xmlEnumMap = new HashMap<String, XmlEnum>();
    aProcessor.init(originalJavaClasses, typeMappingInfos);
    // build a map of packages to JavaClass so we only process the
    // JavaClasses for a given package additional classes - i.e. ones from
    // packages not listed in XML - will be processed later
    Map<String, ArrayList<JavaClass>> pkgToClassMap = buildPackageToJavaClassMap();
    // process each XmlBindings in the map
    XmlBindings xmlBindings;
    for (String packageName : xmlBindingMap.keySet()) {
        ArrayList<JavaClass> classesToProcess = pkgToClassMap.get(packageName);
        if (classesToProcess == null) {
            getLogger().logWarning("jaxb_metadata_warning_no_classes_to_process", new Object[] { packageName });
            continue;
        }
        xmlBindings = xmlBindingMap.get(packageName);
        // handle @XmlSchema override
        NamespaceInfo nsInfo = processXmlSchema(xmlBindings, packageName);
        if (nsInfo != null) {
            aProcessor.addPackageToNamespaceMapping(packageName, nsInfo);
        }
        // handle @XmlElementNillable override
        if (null != xmlBindings.getXmlElementNillable()) {
            aProcessor.addPackageToXmlElementNillable(packageName, xmlBindings.getXmlElementNillable());
        }
        // handle @XmlNullPolicy override
        if (null != xmlBindings.getXmlNullPolicy()) {
            aProcessor.addPackageToXmlNullPolicy(packageName, xmlBindings.getXmlNullPolicy());
        }
        // handle xml-registries
        // add an entry to the map of registries keyed on factory class name for each
        XmlRegistries xmlRegs = xmlBindings.getXmlRegistries();
        if (xmlRegs != null) {
            for (XmlRegistry xmlReg : xmlRegs.getXmlRegistry()) {
                aProcessor.addXmlRegistry(xmlReg.getName(), xmlReg);
            }
        }
        // build an array of JavaModel classes to process
        JavaClass[] javaClasses = classesToProcess.toArray(new JavaClass[classesToProcess.size()]);
        // handle xml-enums
        // build a map of enum class names to XmlEnum objects
        XmlEnums xmlEnums = xmlBindings.getXmlEnums();
        if (xmlEnums != null) {
            for (XmlEnum xmlEnum : xmlEnums.getXmlEnum()) {
                xmlEnumMap.put(getQualifiedJavaTypeName(xmlEnum.getJavaEnum(), packageName), xmlEnum);
            }
        }
        // handle superclass override
        if (xmlBindings.getJavaTypes() != null) {
            List<JavaType> types = xmlBindings.getJavaTypes().getJavaType();
            for (JavaType next : types) {
                JavaClass typeClass = jModelInput.getJavaModel().getClass(getQualifiedJavaTypeName(next.getName(), packageName));
                if (typeClass != null && typeClass.getClass() == JavaClassImpl.class) {
                    if (next.getSuperType() != null && !(next.getSuperType().equals(DEFAULT))) {
                        JavaClass newSuperClass = jModelInput.getJavaModel().getClass(next.getSuperType());
                        ((JavaClassImpl) typeClass).setSuperClassOverride(newSuperClass);
                    }
                }
            }
        }
        // pre-build the TypeInfo objects
        Map<String, TypeInfo> typeInfoMap = aProcessor.preBuildTypeInfo(javaClasses);
        // handle package-level xml-schema-types
        List<XmlSchemaType> xmlSchemaTypes = null;
        XmlSchemaTypes sTypes = xmlBindings.getXmlSchemaTypes();
        if (sTypes != null) {
            xmlSchemaTypes = sTypes.getXmlSchemaType();
        } else {
            xmlSchemaTypes = new ArrayList<XmlSchemaType>();
        }
        // handle package-level xml-schema-type
        if (xmlBindings.getXmlSchemaType() != null) {
            xmlSchemaTypes.add(xmlBindings.getXmlSchemaType());
        }
        // process each xml-schema-type entry
        for (XmlSchemaType sType : xmlSchemaTypes) {
            JavaClass jClass = aProcessor.getHelper().getJavaClass(sType.getType());
            if (jClass != null) {
                aProcessor.processSchemaType(sType.getName(), sType.getNamespace(), jClass.getQualifiedName());
            }
        }
        PackageInfo packageInfo = aProcessor.getPackageToPackageInfoMappings().get(packageName);
        if (packageInfo == null) {
            packageInfo = new PackageInfo();
        }
        if (xmlBindings.isSetXmlAccessorType()) {
            packageInfo.setAccessType(xmlBindings.getXmlAccessorType());
        }
        JavaTypes jTypes = xmlBindings.getJavaTypes();
        if (jTypes != null) {
            for (JavaType javaType : jTypes.getJavaType()) {
                TypeInfo info = typeInfoMap.get(getQualifiedJavaTypeName(javaType.getName(), packageName));
                // handle class-level @XmlJavaTypeAdapter override
                if (javaType.getXmlJavaTypeAdapter() != null) {
                    info.setXmlJavaTypeAdapter(javaType.getXmlJavaTypeAdapter());
                }
                // handle class-level @XmlNullPolicy override
                XmlNullPolicy xmlNullPolicy = javaType.getXmlNullPolicy();
                if (null != xmlNullPolicy) {
                    info.setXmlNullPolicy(xmlNullPolicy);
                }
                // handle class-level @XmlElementNillable override
                XmlElementNillable xmlElementNillable = javaType.getXmlElementNillable();
                if (null != xmlElementNillable) {
                    info.setXmlElementNillable(xmlElementNillable.isNillable());
                }
                // handle class-level @XmlNameTransformer
                String transformerClassName = javaType.getXmlNameTransformer();
                XMLNameTransformer transformer = getXMLNameTransformerClassFromString(transformerClassName);
                if (transformer != null) {
                    info.setXmlNameTransformer(transformer);
                }
                // handle class-level @XmlExtensible override
                if (javaType.getXmlVirtualAccessMethods() != null) {
                    info.setXmlVirtualAccessMethods(javaType.getXmlVirtualAccessMethods());
                }
                // handle class-level @XmlAccessorOrder override
                if (javaType.isSetXmlAccessorOrder()) {
                    info.setXmlAccessOrder(javaType.getXmlAccessorOrder());
                } else if (!info.isSetXmlAccessOrder()) {
                    // handle package-level @XmlAccessorOrder override
                    if (xmlBindings.isSetXmlAccessorOrder()) {
                        info.setXmlAccessOrder(xmlBindings.getXmlAccessorOrder());
                    } else {
                        // finally, check the NamespaceInfo
                        info.setXmlAccessOrder(packageInfo.getAccessOrder());
                    }
                }
                // handle class-level @XmlAccessorType override
                if (javaType.isSetXmlAccessorType()) {
                    info.setXmlAccessType(javaType.getXmlAccessorType());
                }
                // handle @XmlInlineBinaryData override
                if (javaType.isSetXmlInlineBinaryData()) {
                    info.setInlineBinaryData(javaType.isXmlInlineBinaryData());
                }
                // handle @XmlTransient override
                if (javaType.isSetXmlTransient()) {
                    info.setXmlTransient(javaType.isXmlTransient());
                }
                // handle @XmlRootElement
                if (javaType.getXmlRootElement() != null) {
                    info.setXmlRootElement(javaType.getXmlRootElement());
                }
                // handle @XmlSeeAlso override
                if (javaType.getXmlSeeAlso() != null && javaType.getXmlSeeAlso().size() > 0) {
                    info.setXmlSeeAlso(javaType.getXmlSeeAlso());
                }
                // handle @XmlType override
                if (javaType.getXmlType() != null) {
                    info.setXmlType(javaType.getXmlType());
                }
                // handle @XmlCustomizer override
                if (javaType.getXmlCustomizer() != null) {
                    info.setXmlCustomizer(javaType.getXmlCustomizer());
                }
                // handle @XmlClassExtractor override
                if (javaType.getXmlClassExtractor() != null) {
                    info.setClassExtractorName(javaType.getXmlClassExtractor().getClazz());
                }
                // handle @XmlProperties override
                if (javaType.getXmlProperties() != null && javaType.getXmlProperties().getXmlProperty().size() > 0) {
                    // may need to merge with @XmlProperties (xml wins in the case of a conflict)
                    if (info.getUserProperties() != null) {
                        info.setUserProperties(mergeUserPropertyMap(javaType.getXmlProperties().getXmlProperty(), info.getUserProperties()));
                    } else {
                        info.setUserProperties(createUserPropertyMap(javaType.getXmlProperties().getXmlProperty()));
                    }
                }
                // handle @XmlDiscriminatorNode override
                if (javaType.getXmlDiscriminatorNode() != null) {
                    info.setXmlDiscriminatorNode(javaType.getXmlDiscriminatorNode());
                }
                // handle @NamedObjectGraph/@NamedObjectGraphs override
                if (javaType.getXmlNamedObjectGraphs() != null) {
                    List<XmlNamedObjectGraph> currentGraphs = info.getObjectGraphs();
                    for (XmlNamedObjectGraph nextGraph : javaType.getXmlNamedObjectGraphs().getXmlNamedObjectGraph()) {
                        // if not, add the new one
                        for (XmlNamedObjectGraph nextExistingGraph : currentGraphs) {
                            if (nextGraph.getName().equals(nextExistingGraph.getName())) {
                                currentGraphs.remove(nextExistingGraph);
                                break;
                            }
                        }
                    }
                    currentGraphs.addAll(javaType.getXmlNamedObjectGraphs().getXmlNamedObjectGraph());
                }
                // handle @XmlDiscriminatorValue override
                if (javaType.getXmlDiscriminatorValue() != null) {
                    info.setXmlDiscriminatorValue(javaType.getXmlDiscriminatorValue());
                }
            }
        }
        // apply package-level @XmlNameTransformer
        Map<String, TypeInfo> typeInfos = aProcessor.getTypeInfosForPackage(packageName);
        String transformerClassName = xmlBindings.getXmlNameTransformer();
        XMLNameTransformer transformer = getXMLNameTransformerClassFromString(transformerClassName);
        if (transformer != null) {
            packageInfo.setXmlNameTransformer(transformer);
        }
        // apply package-level @XmlJavaTypeAdapters
        for (TypeInfo tInfo : typeInfos.values()) {
            if (xmlBindings.getXmlJavaTypeAdapters() != null) {
                List<XmlJavaTypeAdapter> adapters = xmlBindings.getXmlJavaTypeAdapters().getXmlJavaTypeAdapter();
                for (XmlJavaTypeAdapter xja : adapters) {
                    try {
                        JavaClass adapterClass = jModelInput.getJavaModel().getClass(xja.getValue());
                        JavaClass boundType = jModelInput.getJavaModel().getClass(xja.getType());
                        if (boundType != null) {
                            tInfo.addPackageLevelAdapterClass(adapterClass, boundType);
                            packageInfo.getPackageLevelAdaptersByClass().put(boundType.getQualifiedName(), adapterClass);
                        }
                    } catch (JAXBException e) {
                        throw JAXBException.invalidPackageAdapterClass(xja.getValue(), packageName);
                    }
                }
            }
        }
    }
    for (String packageName : xmlBindingMap.keySet()) {
        ArrayList<JavaClass> classesToProcess = pkgToClassMap.get(packageName);
        if (classesToProcess == null) {
            getLogger().logWarning("jaxb_metadata_warning_no_classes_to_process", new Object[] { packageName });
            continue;
        }
        xmlBindings = xmlBindingMap.get(packageName);
        JavaClass[] javaClasses = classesToProcess.toArray(new JavaClass[classesToProcess.size()]);
        // post-build the TypeInfo objects
        javaClasses = aProcessor.postBuildTypeInfo(javaClasses);
        // get the generated TypeInfo
        Map<String, TypeInfo> typeInfosForPackage = aProcessor.getTypeInfosForPackage(packageName);
        // update xml-enum info if necessary
        for (Entry<String, TypeInfo> entry : typeInfosForPackage.entrySet()) {
            TypeInfo tInfo = entry.getValue();
            if (tInfo.isEnumerationType()) {
                EnumTypeInfo etInfo = (EnumTypeInfo) tInfo;
                XmlEnum xmlEnum = xmlEnumMap.get(etInfo.getClassName());
                if (xmlEnum != null) {
                    JavaClass restrictionClass = aProcessor.getHelper().getJavaClass(xmlEnum.getValue());
                    // default to String if necessary
                    if (restrictionClass == null) {
                        restrictionClass = jModelInput.getJavaModel().getClass(String.class);
                    }
                    etInfo.setRestrictionBase(aProcessor.getSchemaTypeFor(restrictionClass));
                    for (XmlEnumValue xmlEnumValue : xmlEnum.getXmlEnumValue()) {
                        // overwrite any existing entries (from annotations)
                        etInfo.addJavaFieldToXmlEnumValuePair(true, xmlEnumValue.getJavaEnumValue(), xmlEnumValue.getValue());
                    }
                }
            }
        }
        // update TypeInfo objects based on the JavaTypes
        JavaTypes jTypes = xmlBindings.getJavaTypes();
        if (jTypes != null) {
            PackageInfo packageInfo = aProcessor.getPackageToPackageInfoMappings().get(packageName);
            NamespaceInfo nsInfo = null;
            if (null != packageInfo) {
                nsInfo = packageInfo.getNamespaceInfo();
            }
            for (JavaType javaType : jTypes.getJavaType()) {
                processJavaType(javaType, typeInfosForPackage.get(getQualifiedJavaTypeName(javaType.getName(), packageName)), nsInfo);
            }
        }
        // remove the entry for this package from the map
        pkgToClassMap.remove(packageName);
    }
    // now process remaining classes
    Iterator<ArrayList<JavaClass>> classIt = pkgToClassMap.values().iterator();
    while (classIt.hasNext()) {
        ArrayList<JavaClass> jClassList = classIt.next();
        JavaClass[] jClassArray = jClassList.toArray(new JavaClass[jClassList.size()]);
        aProcessor.buildNewTypeInfo(jClassArray);
        aProcessor.checkForCallbackMethods();
    }
    // need to ensure that any bound types (from XmlJavaTypeAdapter) have TypeInfo
    // objects built for them - SchemaGenerator will require a descriptor for each
    Map<String, TypeInfo> typeInfos = (Map<String, TypeInfo>) ((HashMap) aProcessor.getTypeInfos()).clone();
    for (Entry<String, TypeInfo> entry : typeInfos.entrySet()) {
        JavaClass[] jClassArray;
        for (Property prop : entry.getValue().getPropertyList()) {
            if (prop.isSetXmlJavaTypeAdapter()) {
                jClassArray = new JavaClass[] { prop.getActualType() };
                aProcessor.buildNewTypeInfo(jClassArray);
            }
        }
    }
    // now trigger the annotations processor to process the classes
    List<JavaClass> jClasses = aProcessor.getTypeInfoClasses();
    // (in case super and sub classes were in different packages)
    if (xmlBindingMap.size() > 1) {
        for (JavaClass c : jClasses) {
            TypeInfo ti = aProcessor.getTypeInfos().get(c.getQualifiedName());
            aProcessor.processPropertiesSuperClass(c, ti);
        }
    }
    aProcessor.processPropertyTypes(jClasses.toArray(new JavaClass[jClasses.size()]));
    aProcessor.finalizeProperties();
    aProcessor.createElementsForTypeMappingInfo();
    aProcessor.checkForCallbackMethods();
}
Also used : JavaTypes(org.eclipse.persistence.jaxb.xmlmodel.XmlBindings.JavaTypes) XmlBindings(org.eclipse.persistence.jaxb.xmlmodel.XmlBindings) HashMap(java.util.HashMap) XmlNamedObjectGraph(org.eclipse.persistence.jaxb.xmlmodel.XmlNamedObjectGraph) ArrayList(java.util.ArrayList) JavaClassImpl(org.eclipse.persistence.jaxb.javamodel.reflection.JavaClassImpl) XMLNameTransformer(org.eclipse.persistence.oxm.XMLNameTransformer) XmlProperty(org.eclipse.persistence.jaxb.xmlmodel.XmlProperties.XmlProperty) XmlEnums(org.eclipse.persistence.jaxb.xmlmodel.XmlBindings.XmlEnums) XmlJavaTypeAdapter(org.eclipse.persistence.jaxb.xmlmodel.XmlJavaTypeAdapter) JAXBException(org.eclipse.persistence.exceptions.JAXBException) XmlRegistry(org.eclipse.persistence.jaxb.xmlmodel.XmlRegistry) XmlSchemaType(org.eclipse.persistence.jaxb.xmlmodel.XmlSchemaType) XmlSchemaTypes(org.eclipse.persistence.jaxb.xmlmodel.XmlSchemaTypes) XmlEnum(org.eclipse.persistence.jaxb.xmlmodel.XmlEnum) JavaType(org.eclipse.persistence.jaxb.xmlmodel.JavaType) XmlNullPolicy(org.eclipse.persistence.jaxb.xmlmodel.XmlNullPolicy) JavaClass(org.eclipse.persistence.jaxb.javamodel.JavaClass) XmlElementNillable(org.eclipse.persistence.jaxb.xmlmodel.XmlElementNillable) XmlRegistries(org.eclipse.persistence.jaxb.xmlmodel.XmlBindings.XmlRegistries) XmlEnumValue(org.eclipse.persistence.jaxb.xmlmodel.XmlEnumValue) XmlMap(org.eclipse.persistence.jaxb.xmlmodel.XmlMap) Map(java.util.Map) HashMap(java.util.HashMap)

Example 3 with JavaClassImpl

use of org.eclipse.persistence.jaxb.javamodel.reflection.JavaClassImpl in project eclipselink by eclipse-ee4j.

the class OXMMetadata method getJavaModelInput.

@Override
public JavaModelInput getJavaModelInput() throws JAXBException {
    JavaClass[] elinkClasses = createClassModelFromOXM(dynamicClassLoader);
    // Use the JavaModel to setup a Generator to generate an EclipseLink project
    OXMJavaModelImpl javaModel = new OXMJavaModelImpl(dynamicClassLoader, elinkClasses);
    for (JavaClass javaClass : elinkClasses) {
        try {
            ((OXMJavaClassImpl) javaClass).setJavaModel(javaModel);
        } catch (ClassCastException cce) {
            try {
                ((OXMObjectFactoryImpl) javaClass).setJavaModel(javaModel);
                ((OXMObjectFactoryImpl) javaClass).init();
            } catch (ClassCastException cce2) {
                ((JavaClassImpl) javaClass).setJavaModelImpl(javaModel);
            }
        }
    }
    return new OXMJavaModelInputImpl(elinkClasses, javaModel);
}
Also used : OXMJavaClassImpl(org.eclipse.persistence.jaxb.javamodel.oxm.OXMJavaClassImpl) JavaClassImpl(org.eclipse.persistence.jaxb.javamodel.reflection.JavaClassImpl) JavaClass(org.eclipse.persistence.jaxb.javamodel.JavaClass) OXMJavaModelImpl(org.eclipse.persistence.jaxb.javamodel.oxm.OXMJavaModelImpl) OXMJavaClassImpl(org.eclipse.persistence.jaxb.javamodel.oxm.OXMJavaClassImpl) OXMJavaModelInputImpl(org.eclipse.persistence.jaxb.javamodel.oxm.OXMJavaModelInputImpl)

Example 4 with JavaClassImpl

use of org.eclipse.persistence.jaxb.javamodel.reflection.JavaClassImpl in project eclipselink by eclipse-ee4j.

the class OXMJavaModelImpl method getClass.

/**
 * Obtain the <code>JavaClass</code> given the corresponding Java <code>Class</code>.
 *
 * @param jClass - the Java <code>Class</code> to search for.
 *
 * @return the <code>JavaClass</code> corresponding to <code>jClass</code>.
 */
@Override
public JavaClass getClass(Class<?> jClass) {
    if (jClass == null) {
        return null;
    }
    String className = jClass.getCanonicalName();
    JavaClass cachedClass = this.javaModelClasses.get(className);
    if (cachedClass != null) {
        return cachedClass;
    }
    // try actually finding the class, might be concrete
    try {
        if (jClass.isArray()) {
            className = jClass.getName();
        }
        Class<?> realClass = PrivilegedAccessHelper.getClassForName(className, true, classLoader);
        if (realClass != null) {
            JavaModelImpl jm = new JavaModelImpl(classLoader);
            JavaClassImpl jc = new JavaClassImpl(realClass, jm);
            return jc;
        }
    } catch (Exception e) {
    }
    return new OXMJavaClassImpl(jClass.getCanonicalName());
}
Also used : JavaClassImpl(org.eclipse.persistence.jaxb.javamodel.reflection.JavaClassImpl) JavaClass(org.eclipse.persistence.jaxb.javamodel.JavaClass) JavaModelImpl(org.eclipse.persistence.jaxb.javamodel.reflection.JavaModelImpl)

Example 5 with JavaClassImpl

use of org.eclipse.persistence.jaxb.javamodel.reflection.JavaClassImpl in project eclipselink by eclipse-ee4j.

the class JaxbContextCreationTests method testJavaClassImplWildcard.

public void testJavaClassImplWildcard() throws Exception {
    ParameterizedType pType = (ParameterizedType) WildCardTest.class.getField("testField").getGenericType();
    JavaClassImpl javaClass = new JavaClassImpl(pType, java.util.List.class, null);
    boolean hasArgs = javaClass.hasActualTypeArguments();
    Collection getArgs = javaClass.getActualTypeArguments();
    assertFalse(hasArgs);
    assertTrue(getArgs.size() == 0);
}
Also used : ParameterizedType(java.lang.reflect.ParameterizedType) JavaClassImpl(org.eclipse.persistence.jaxb.javamodel.reflection.JavaClassImpl) java.util(java.util)

Aggregations

JavaClassImpl (org.eclipse.persistence.jaxb.javamodel.reflection.JavaClassImpl)8 JavaClass (org.eclipse.persistence.jaxb.javamodel.JavaClass)6 JAXBException (jakarta.xml.bind.JAXBException)2 ParameterizedType (java.lang.reflect.ParameterizedType)2 ArrayList (java.util.ArrayList)2 OXMJavaClassImpl (org.eclipse.persistence.jaxb.javamodel.oxm.OXMJavaClassImpl)2 JavaModelImpl (org.eclipse.persistence.jaxb.javamodel.reflection.JavaModelImpl)2 JavaType (org.eclipse.persistence.jaxb.xmlmodel.JavaType)2 XmlBindings (org.eclipse.persistence.jaxb.xmlmodel.XmlBindings)2 XmlEnum (org.eclipse.persistence.jaxb.xmlmodel.XmlEnum)2 XmlEnumValue (org.eclipse.persistence.jaxb.xmlmodel.XmlEnumValue)2 XmlRegistry (org.eclipse.persistence.jaxb.xmlmodel.XmlRegistry)2 Field (java.lang.reflect.Field)1 GenericArrayType (java.lang.reflect.GenericArrayType)1 Method (java.lang.reflect.Method)1 Type (java.lang.reflect.Type)1 TypeVariable (java.lang.reflect.TypeVariable)1 java.util (java.util)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1