@Override void init() { if (originalBeanInfoSearchPath == null) { originalBeanInfoSearchPath = Arrays.asList(Introspector.getBeanInfoSearchPath()); } } };
/** Checks whether there is an explicit bean info for given class. * @param clazz the class to test * @return true if explicit bean info exists */ private boolean hasExplicitBeanInfo(Class<?> clazz) { String className = clazz.getName(); int indx = className.lastIndexOf('.'); className = className.substring(indx + 1); String[] paths = Introspector.getBeanInfoSearchPath(); for (int i = 0; i < paths.length; i++) { String s = paths[i] + '.' + className + "BeanInfo"; // NOI18N try { // test if such class exists Class.forName(s); return true; } catch (ClassNotFoundException ex) { // OK, this is normal. } } return false; }
public static void addJaxxBeanInfoPath(String... packageNames) { String[] searchPath = Introspector.getBeanInfoSearchPath(); if (originalBeanInfoSearchPath == null) { originalBeanInfoSearchPath = searchPath; } List<String> listSearchPath = new ArrayList<>(Arrays.asList(searchPath)); for (String packageName : packageNames) { if (!listSearchPath.contains(packageName)) { listSearchPath.add(packageName); } } Introspector.setBeanInfoSearchPath(listSearchPath.toArray(new String[listSearchPath.size()])); }
public static void addJaxxBeanInfoPath(String... packageNames) { String[] searchPath = Introspector.getBeanInfoSearchPath(); if (originalBeanInfoSearchPath == null) { originalBeanInfoSearchPath = searchPath; } List<String> listSearchPath = new ArrayList<>(Arrays.asList(searchPath)); for (String packageName : packageNames) { if (!listSearchPath.contains(packageName)) { listSearchPath.add(packageName); } } Introspector.setBeanInfoSearchPath(listSearchPath.toArray(new String[listSearchPath.size()])); }
@Override public void restored() { // Add our beaninfo packages to introspector search path. String[] sp = Introspector.getBeanInfoSearchPath(); String[] newSP = new String[sp.length + BEANINFO_PATHS.length]; System.arraycopy(sp, 0, newSP, 0, sp.length); System.arraycopy(BEANINFO_PATHS, 0, newSP, sp.length, BEANINFO_PATHS.length); Introspector.setBeanInfoSearchPath(newSP); }
public String[] addBeanInfoSearchPath(final String[] additionalBeanInfoPath) { final String[] beanInfoSearchPath = Introspector.getBeanInfoSearchPath(); final List<String> list = new ArrayList<String>(beanInfoSearchPath.length + additionalBeanInfoPath.length); Collections.addAll(list, beanInfoSearchPath); Collections.addAll(list, additionalBeanInfoPath); Introspector.setBeanInfoSearchPath(list.toArray(new String[0])); return beanInfoSearchPath; }
@Override public void restored() { // Add our beaninfo packages to introspector search path. String[] sp = Introspector.getBeanInfoSearchPath(); String[] newSP = new String[sp.length + BEANINFO_PATHS.length]; System.arraycopy(sp, 0, newSP, 0, sp.length); System.arraycopy(BEANINFO_PATHS, 0, newSP, sp.length, BEANINFO_PATHS.length); Introspector.setBeanInfoSearchPath(newSP); }
@Override public void uninstalled() { // Remove our beaninfo packages from the intropsector search path. String[] sp = Introspector.getBeanInfoSearchPath(); List paths = Arrays.asList(sp); for (int i = 0; i < BEANINFO_PATHS.length; i++) { if(paths.contains(BEANINFO_PATHS[i])) { paths = new ArrayList(paths); paths.remove(BEANINFO_PATHS[i]); } } Introspector.setBeanInfoSearchPath((String[])paths.toArray(new String[paths.size()])); }
@Override public void uninstalled() { // Remove our beaninfo packages from the intropsector search path. String[] sp = Introspector.getBeanInfoSearchPath(); List paths = Arrays.asList(sp); for (int i = 0; i < BEANINFO_PATHS.length; i++) { if(paths.contains(BEANINFO_PATHS[i])) { paths = new ArrayList(paths); paths.remove(BEANINFO_PATHS[i]); } } Introspector.setBeanInfoSearchPath((String[])paths.toArray(new String[paths.size()])); }
/** Checks whether there is an explicit bean info for given class. * @param clazz the class to test * @return true if explicit bean info exists */ private boolean hasExplicitBeanInfo (Class clazz) { String className = clazz.getName (); int indx = className.lastIndexOf('.'); className = className.substring (indx + 1); String[] paths = Introspector.getBeanInfoSearchPath(); for (int i = 0; i < paths.length; i++) { String s = paths[i] + '.' + className + "BeanInfo"; // NOI18N try { // test if such class exists Class.forName (s); return true; } catch (ClassNotFoundException ex) { // OK, this is normal. } } return false; }
/** Checks whether there is an explicit bean info for given class. * @param clazz the class to test * @return true if explicit bean info exists */ private boolean hasExplicitBeanInfo (Class clazz) { String className = clazz.getName (); int indx = className.lastIndexOf('.'); className = className.substring (indx + 1); String[] paths = Introspector.getBeanInfoSearchPath(); for (int i = 0; i < paths.length; i++) { String s = paths[i] + '.' + className + "BeanInfo"; // NOI18N try { // test if such class exists Class.forName (s); return true; } catch (ClassNotFoundException ex) { // OK, this is normal. } } return false; }
List bisp = Arrays.asList(Introspector.getBeanInfoSearchPath()); if (!bisp.contains(JSFCL_DATA_BEANINFO_PATH)) { bisp = new ArrayList(bisp);