@Test public void testDetectArrayClass() { assertEquals("int", classInspectionService.inspectClass(int[].class, CollectionType.ARRAY, null).getClassName()); assertEquals("java.lang.String", classInspectionService.inspectClass(String[][].class, CollectionType.ARRAY, null).getClassName()); assertEquals("java.util.List", classInspectionService.inspectClass(List[][][].class, CollectionType.ARRAY, null).getClassName()); assertEquals("java.util.Map", classInspectionService.inspectClass(Map[][][][].class, CollectionType.ARRAY, null).getClassName()); }
private Class<?> detectArrayClass(Class<?> clazz) { Integer arrayDim = new Integer(0); if (clazz == null) { return null; } if (!clazz.isArray()) { return clazz; } arrayDim++; Class<?> tmpClazz = clazz.getComponentType(); while (tmpClazz != null && tmpClazz.isArray() && arrayDim < MAX_ARRAY_DIM_LIMIT) { arrayDim++; tmpClazz = tmpClazz.getComponentType(); } return tmpClazz; }
ClassInspectionService { private Class<?> detectArrayClass(Class<?> clazz) { Integer arrayDim = new Integer(0); if (clazz == null) { return null; } if (!clazz.isArray()) { return clazz; } arrayDim++; Class<?> tmpClazz = clazz.getComponentType(); while (tmpClazz != null && tmpClazz.isArray() && arrayDim < MAX_ARRAY_DIM_LIMIT) { arrayDim++; tmpClazz = tmpClazz.getComponentType(); } return tmpClazz; } }
ClassInspectionService { private Class<?> detectArrayClass(Class<?> clazz) { Integer arrayDim = new Integer(0); if (clazz == null) { return null; } if (!clazz.isArray()) { return clazz; } arrayDim++; Class<?> tmpClazz = clazz.getComponentType(); while (tmpClazz != null && tmpClazz.isArray() && arrayDim < MAX_ARRAY_DIM_LIMIT) { arrayDim++; tmpClazz = tmpClazz.getComponentType(); } return tmpClazz; }  }
ClassInspectionService { private Class<?> detectArrayClass(Class<?> clazz) { Integer arrayDim = new Integer(0); if (clazz == null) { return null; } if (!clazz.isArray()) { return clazz; } arrayDim++; Class<?> tmpClazz = clazz.getComponentType(); while (tmpClazz != null && tmpClazz.isArray() && arrayDim < MAX_ARRAY_DIM_LIMIT) { arrayDim++; tmpClazz = tmpClazz.getComponentType(); } return tmpClazz; }  List<String> getMapClasses(); List<String> getListClasses(); List<String> getClassNameBlacklist(); List<String> getFieldBlacklist(); Boolean getDisableProtectedOnlyFields(); void setDisableProtectedOnlyFields(Boolean disableProtectedOnlyFields); Boolean getDisablePackagePrivateOnlyFields(); void setDisablePackagePrivateOnlyFields(Boolean disablePackagePrivateOnlyFields); Boolean getDisablePrivateOnlyFields(); void setDisablePrivateOnlyFields(Boolean disablePrivateOnlyFields); Boolean getDisablePublicOnlyFields(); void setDisablePublicOnlyFields(Boolean disablePublicOnlyFields); Boolean getDisablePublicGetterSetterFields(); void setDisablePublicGetterSetterFields(Boolean disablePublicGetterSetterFields); JavaClass inspectClass(String className, CollectionType collectionType, String collectionClassName); JavaClass inspectClass(ClassLoader classLoader, String className, CollectionType collectionType, String collectionClassName); JavaClass inspectClass(String className, CollectionType collectionType, String collectionClassName, String classpath); JavaClass inspectClass(Class<?> clazz, CollectionType collectionType, String collectionClassName); JavaClass inspectClass(ClassLoader classLoader, Class<?> clazz, CollectionType collectionType, String collectionClassName); void setConversionService(AtlasConversionService atlasConversionService); }
ClassInspectionService { private Class<?> detectArrayClass(Class<?> clazz) { Integer arrayDim = new Integer(0); if (clazz == null) { return null; } if (!clazz.isArray()) { return clazz; } arrayDim++; Class<?> tmpClazz = clazz.getComponentType(); while (tmpClazz != null && tmpClazz.isArray() && arrayDim < MAX_ARRAY_DIM_LIMIT) { arrayDim++; tmpClazz = tmpClazz.getComponentType(); } return tmpClazz; }  List<String> getMapClasses(); List<String> getListClasses(); List<String> getClassNameBlacklist(); List<String> getFieldBlacklist(); Boolean getDisableProtectedOnlyFields(); void setDisableProtectedOnlyFields(Boolean disableProtectedOnlyFields); Boolean getDisablePackagePrivateOnlyFields(); void setDisablePackagePrivateOnlyFields(Boolean disablePackagePrivateOnlyFields); Boolean getDisablePrivateOnlyFields(); void setDisablePrivateOnlyFields(Boolean disablePrivateOnlyFields); Boolean getDisablePublicOnlyFields(); void setDisablePublicOnlyFields(Boolean disablePublicOnlyFields); Boolean getDisablePublicGetterSetterFields(); void setDisablePublicGetterSetterFields(Boolean disablePublicGetterSetterFields); JavaClass inspectClass(String className, CollectionType collectionType, String collectionClassName); JavaClass inspectClass(ClassLoader classLoader, String className, CollectionType collectionType, String collectionClassName); JavaClass inspectClass(String className, CollectionType collectionType, String collectionClassName, String classpath); JavaClass inspectClass(Class<?> clazz, CollectionType collectionType, String collectionClassName); JavaClass inspectClass(ClassLoader classLoader, Class<?> clazz, CollectionType collectionType, String collectionClassName); void setConversionService(AtlasConversionService atlasConversionService); static final int MAX_REENTRY_LIMIT; static final int MAX_ARRAY_DIM_LIMIT; }