List of usage examples for java.beans IntrospectionException printStackTrace
public void printStackTrace()
From source file:com.zhumeng.dream.orm.hibernate.HibernateDao.java
/** * ?,hibernate???select count(o) from Xxx o?BUG, * hibernatejpql??sqlselect count(field1,field2,...),count() * ??HQL?:"select count(*) from Object"//from w w w.j a va 2 s . co m * @author: lizhong * @param <E> * @param clazz * @return */ protected static <E> String getCountField(Class<E> clazz) { String out = "o"; try { PropertyDescriptor[] propertys = Introspector.getBeanInfo(clazz).getPropertyDescriptors(); for (PropertyDescriptor property : propertys) { Method method = property.getReadMethod(); if (method != null && method.isAnnotationPresent(EmbeddedId.class)) { PropertyDescriptor[] props = Introspector.getBeanInfo(property.getPropertyType()) .getPropertyDescriptors(); out = "o." + property.getName() + "." + (!props[1].getName().equals("class") ? props[1].getName() : props[0].getName()); break; } } } catch (IntrospectionException e) { e.printStackTrace(); } return out; }
From source file:fedora.server.security.servletfilters.xmluserfile.FedoraUsers.java
public void write(Writer outputWriter) throws IOException { outputWriter.write("<?xml version='1.0' ?>\n"); BeanWriter beanWriter = new BeanWriter(outputWriter); beanWriter.getBindingConfiguration().setMapIDs(false); beanWriter.setWriteEmptyElements(false); beanWriter.enablePrettyPrint();/*from w w w .j a v a2 s .c o m*/ try { beanWriter.getXMLIntrospector().register(getBetwixtMapping()); beanWriter.write("users", this); } catch (IntrospectionException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } beanWriter.flush(); beanWriter.close(); }
From source file:org.apache.struts2.views.xslt.BeanAdapter.java
/** * Caching facade method to Introspector.getBeanInfo(Class, Class).getPropertyDescriptors(); *///w w w . j ava 2s . c om private synchronized PropertyDescriptor[] getPropertyDescriptors(Object bean) { try { if (propertyDescriptorCache == null) { propertyDescriptorCache = new HashMap<Class, PropertyDescriptor[]>(); } PropertyDescriptor[] props = propertyDescriptorCache.get(bean.getClass()); if (props == null) { log.debug("Caching property descriptor for " + bean.getClass().getName()); props = Introspector.getBeanInfo(bean.getClass(), Object.class).getPropertyDescriptors(); propertyDescriptorCache.put(bean.getClass(), props); } return props; } catch (IntrospectionException e) { e.printStackTrace(); throw new StrutsException("Error getting property descriptors for " + bean + " : " + e.getMessage()); } }
From source file:yp.tibco.com.yang.lottery.server.LotteryServerIoHandler.java
public Object xmlString2Object(String xmlString, String className, Class cl) { StringReader xmlReader = new StringReader(xmlString); BeanReader beanReader = new BeanReader(); beanReader.getXMLIntrospector().setAttributesForPrimitives(false); try {// www . jav a2s .co m //beanReader.registerBeanClass("SelectUserIDListBean", SelectUserIDListBean.class); beanReader.registerBeanClass(className, cl); } catch (IntrospectionException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // XMLJava Object Object obj = null; try { obj = beanReader.parse(xmlReader); } catch (IOException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } return obj; }
From source file:fedora.server.config.webxml.WebXML.java
public void write(Writer outputWriter) throws IOException { ////from w ww .ja va 2 s .c o m NamespacePrefixMapper nspm = new NamespacePrefixMapper(); nspm.setPrefix(XSI.uri, "xsi"); nspm.setPrefix("http://java.sun.com/xml/ns/j2ee", "xmlns"); // outputWriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); BeanWriter beanWriter = new BeanWriter(outputWriter); beanWriter.getBindingConfiguration().setMapIDs(false); beanWriter.setWriteEmptyElements(false); beanWriter.enablePrettyPrint(); try { beanWriter.getXMLIntrospector().register(getBetwixtMapping()); beanWriter.getXMLIntrospector().getConfiguration().setPrefixMapper(nspm); beanWriter.write("web-app", this); } catch (IntrospectionException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } beanWriter.flush(); beanWriter.close(); }
From source file:org.archive.crawler.restlet.JobRelatedResource.java
protected void defaultUpdateDescriptor(PropertyDescriptor pd) { // make non-editable try {//from w w w . j a v a 2s . c om pd.setWriteMethod(null); } catch (IntrospectionException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (HIDDEN_PROPS.contains(pd.getName())) { pd.setHidden(true); } }
From source file:facebean.FaceBeanBeanInfo.java
private static EventSetDescriptor[] getEdescriptor() { EventSetDescriptor[] eventSets = new EventSetDescriptor[13]; try {/* w w w . j a v a 2 s . co m*/ eventSets[EVENT_ancestorListener] = new EventSetDescriptor(facebean.FaceBean.class, "ancestorListener", javax.swing.event.AncestorListener.class, new String[] { "ancestorAdded", "ancestorRemoved", "ancestorMoved" }, "addAncestorListener", "removeAncestorListener"); // NOI18N eventSets[EVENT_ancestorListener].setHidden(true); eventSets[EVENT_componentListener] = new EventSetDescriptor(facebean.FaceBean.class, "componentListener", java.awt.event.ComponentListener.class, new String[] { "componentResized", "componentMoved", "componentShown", "componentHidden" }, "addComponentListener", "removeComponentListener"); // NOI18N eventSets[EVENT_componentListener].setHidden(true); eventSets[EVENT_containerListener] = new EventSetDescriptor(facebean.FaceBean.class, "containerListener", java.awt.event.ContainerListener.class, new String[] { "componentAdded", "componentRemoved" }, "addContainerListener", "removeContainerListener"); // NOI18N eventSets[EVENT_containerListener].setHidden(true); eventSets[EVENT_focusListener] = new EventSetDescriptor(facebean.FaceBean.class, "focusListener", java.awt.event.FocusListener.class, new String[] { "focusGained", "focusLost" }, "addFocusListener", "removeFocusListener"); // NOI18N eventSets[EVENT_focusListener].setHidden(true); eventSets[EVENT_hierarchyBoundsListener] = new EventSetDescriptor(facebean.FaceBean.class, "hierarchyBoundsListener", java.awt.event.HierarchyBoundsListener.class, new String[] { "ancestorMoved", "ancestorResized" }, "addHierarchyBoundsListener", "removeHierarchyBoundsListener"); // NOI18N eventSets[EVENT_hierarchyBoundsListener].setHidden(true); eventSets[EVENT_hierarchyListener] = new EventSetDescriptor(facebean.FaceBean.class, "hierarchyListener", java.awt.event.HierarchyListener.class, new String[] { "hierarchyChanged" }, "addHierarchyListener", "removeHierarchyListener"); // NOI18N eventSets[EVENT_hierarchyListener].setHidden(true); eventSets[EVENT_inputMethodListener] = new EventSetDescriptor(facebean.FaceBean.class, "inputMethodListener", java.awt.event.InputMethodListener.class, new String[] { "inputMethodTextChanged", "caretPositionChanged" }, "addInputMethodListener", "removeInputMethodListener"); // NOI18N eventSets[EVENT_inputMethodListener].setHidden(true); eventSets[EVENT_keyListener] = new EventSetDescriptor(facebean.FaceBean.class, "keyListener", java.awt.event.KeyListener.class, new String[] { "keyTyped", "keyPressed", "keyReleased" }, "addKeyListener", "removeKeyListener"); // NOI18N eventSets[EVENT_keyListener].setHidden(true); eventSets[EVENT_mouseListener] = new EventSetDescriptor(facebean.FaceBean.class, "mouseListener", java.awt.event.MouseListener.class, new String[] { "mouseClicked", "mousePressed", "mouseReleased", "mouseEntered", "mouseExited" }, "addMouseListener", "removeMouseListener"); // NOI18N eventSets[EVENT_mouseListener].setHidden(true); eventSets[EVENT_mouseMotionListener] = new EventSetDescriptor(facebean.FaceBean.class, "mouseMotionListener", java.awt.event.MouseMotionListener.class, new String[] { "mouseDragged", "mouseMoved" }, "addMouseMotionListener", "removeMouseMotionListener"); // NOI18N eventSets[EVENT_mouseMotionListener].setHidden(true); eventSets[EVENT_mouseWheelListener] = new EventSetDescriptor(facebean.FaceBean.class, "mouseWheelListener", java.awt.event.MouseWheelListener.class, new String[] { "mouseWheelMoved" }, "addMouseWheelListener", "removeMouseWheelListener"); // NOI18N eventSets[EVENT_mouseWheelListener].setHidden(true); eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor(facebean.FaceBean.class, "propertyChangeListener", java.beans.PropertyChangeListener.class, new String[] { "propertyChange" }, "addPropertyChangeListener", "removePropertyChangeListener"); // NOI18N eventSets[EVENT_propertyChangeListener].setHidden(true); eventSets[EVENT_vetoableChangeListener] = new EventSetDescriptor(facebean.FaceBean.class, "vetoableChangeListener", java.beans.VetoableChangeListener.class, new String[] { "vetoableChange" }, "addVetoableChangeListener", "removeVetoableChangeListener"); // NOI18N eventSets[EVENT_vetoableChangeListener].setHidden(true); } catch (IntrospectionException e) { e.printStackTrace(); } //GEN-HEADEREND:Events // Here you can add code for customizing the event sets array. return eventSets; }
From source file:facebean.FaceBeanBeanInfo.java
private static PropertyDescriptor[] getPdescriptor() { PropertyDescriptor[] properties = new PropertyDescriptor[101]; try {//from www . jav a 2 s.c om properties[PROPERTY_accessibleContext] = new PropertyDescriptor("accessibleContext", facebean.FaceBean.class, "getAccessibleContext", null); // NOI18N properties[PROPERTY_accessibleContext].setHidden(true); properties[PROPERTY_actionMap] = new PropertyDescriptor("actionMap", facebean.FaceBean.class, "getActionMap", "setActionMap"); // NOI18N properties[PROPERTY_actionMap].setHidden(true); properties[PROPERTY_alignmentX] = new PropertyDescriptor("alignmentX", facebean.FaceBean.class, "getAlignmentX", "setAlignmentX"); // NOI18N properties[PROPERTY_alignmentX].setHidden(true); properties[PROPERTY_alignmentY] = new PropertyDescriptor("alignmentY", facebean.FaceBean.class, "getAlignmentY", "setAlignmentY"); // NOI18N properties[PROPERTY_alignmentY].setHidden(true); properties[PROPERTY_ancestorListeners] = new PropertyDescriptor("ancestorListeners", facebean.FaceBean.class, "getAncestorListeners", null); // NOI18N properties[PROPERTY_ancestorListeners].setHidden(true); properties[PROPERTY_autoscrolls] = new PropertyDescriptor("autoscrolls", facebean.FaceBean.class, "getAutoscrolls", "setAutoscrolls"); // NOI18N properties[PROPERTY_autoscrolls].setHidden(true); properties[PROPERTY_background] = new PropertyDescriptor("background", facebean.FaceBean.class, "getBackground", "setBackground"); // NOI18N properties[PROPERTY_background].setPreferred(true); properties[PROPERTY_backgroundSet] = new PropertyDescriptor("backgroundSet", facebean.FaceBean.class, "isBackgroundSet", null); // NOI18N properties[PROPERTY_backgroundSet].setHidden(true); properties[PROPERTY_baselineResizeBehavior] = new PropertyDescriptor("baselineResizeBehavior", facebean.FaceBean.class, "getBaselineResizeBehavior", null); // NOI18N properties[PROPERTY_baselineResizeBehavior].setHidden(true); properties[PROPERTY_border] = new PropertyDescriptor("border", facebean.FaceBean.class, "getBorder", "setBorder"); // NOI18N properties[PROPERTY_border].setHidden(true); properties[PROPERTY_bounds] = new PropertyDescriptor("bounds", facebean.FaceBean.class, "getBounds", "setBounds"); // NOI18N properties[PROPERTY_bounds].setHidden(true); properties[PROPERTY_colorModel] = new PropertyDescriptor("colorModel", facebean.FaceBean.class, "getColorModel", null); // NOI18N properties[PROPERTY_colorModel].setHidden(true); properties[PROPERTY_component] = new IndexedPropertyDescriptor("component", facebean.FaceBean.class, null, null, "getComponent", null); // NOI18N properties[PROPERTY_component].setHidden(true); properties[PROPERTY_componentCount] = new PropertyDescriptor("componentCount", facebean.FaceBean.class, "getComponentCount", null); // NOI18N properties[PROPERTY_componentCount].setHidden(true); properties[PROPERTY_componentListeners] = new PropertyDescriptor("componentListeners", facebean.FaceBean.class, "getComponentListeners", null); // NOI18N properties[PROPERTY_componentListeners].setHidden(true); properties[PROPERTY_componentOrientation] = new PropertyDescriptor("componentOrientation", facebean.FaceBean.class, "getComponentOrientation", "setComponentOrientation"); // NOI18N properties[PROPERTY_componentOrientation].setHidden(true); properties[PROPERTY_componentPopupMenu] = new PropertyDescriptor("componentPopupMenu", facebean.FaceBean.class, "getComponentPopupMenu", "setComponentPopupMenu"); // NOI18N properties[PROPERTY_componentPopupMenu].setHidden(true); properties[PROPERTY_components] = new PropertyDescriptor("components", facebean.FaceBean.class, "getComponents", null); // NOI18N properties[PROPERTY_components].setHidden(true); properties[PROPERTY_containerListeners] = new PropertyDescriptor("containerListeners", facebean.FaceBean.class, "getContainerListeners", null); // NOI18N properties[PROPERTY_containerListeners].setHidden(true); properties[PROPERTY_cursor] = new PropertyDescriptor("cursor", facebean.FaceBean.class, "getCursor", "setCursor"); // NOI18N properties[PROPERTY_cursor].setHidden(true); properties[PROPERTY_cursorSet] = new PropertyDescriptor("cursorSet", facebean.FaceBean.class, "isCursorSet", null); // NOI18N properties[PROPERTY_cursorSet].setHidden(true); properties[PROPERTY_debugGraphicsOptions] = new PropertyDescriptor("debugGraphicsOptions", facebean.FaceBean.class, "getDebugGraphicsOptions", "setDebugGraphicsOptions"); // NOI18N properties[PROPERTY_debugGraphicsOptions].setHidden(true); properties[PROPERTY_displayable] = new PropertyDescriptor("displayable", facebean.FaceBean.class, "isDisplayable", null); // NOI18N properties[PROPERTY_displayable].setHidden(true); properties[PROPERTY_doubleBuffered] = new PropertyDescriptor("doubleBuffered", facebean.FaceBean.class, "isDoubleBuffered", "setDoubleBuffered"); // NOI18N properties[PROPERTY_doubleBuffered].setHidden(true); properties[PROPERTY_dropTarget] = new PropertyDescriptor("dropTarget", facebean.FaceBean.class, "getDropTarget", "setDropTarget"); // NOI18N properties[PROPERTY_dropTarget].setHidden(true); properties[PROPERTY_enabled] = new PropertyDescriptor("enabled", facebean.FaceBean.class, "isEnabled", "setEnabled"); // NOI18N properties[PROPERTY_enabled].setHidden(true); properties[PROPERTY_focusable] = new PropertyDescriptor("focusable", facebean.FaceBean.class, "isFocusable", "setFocusable"); // NOI18N properties[PROPERTY_focusable].setHidden(true); properties[PROPERTY_focusCycleRoot] = new PropertyDescriptor("focusCycleRoot", facebean.FaceBean.class, "isFocusCycleRoot", "setFocusCycleRoot"); // NOI18N properties[PROPERTY_focusCycleRoot].setHidden(true); properties[PROPERTY_focusCycleRootAncestor] = new PropertyDescriptor("focusCycleRootAncestor", facebean.FaceBean.class, "getFocusCycleRootAncestor", null); // NOI18N properties[PROPERTY_focusCycleRootAncestor].setHidden(true); properties[PROPERTY_focusListeners] = new PropertyDescriptor("focusListeners", facebean.FaceBean.class, "getFocusListeners", null); // NOI18N properties[PROPERTY_focusListeners].setHidden(true); properties[PROPERTY_focusOwner] = new PropertyDescriptor("focusOwner", facebean.FaceBean.class, "isFocusOwner", null); // NOI18N properties[PROPERTY_focusOwner].setHidden(true); properties[PROPERTY_focusTraversable] = new PropertyDescriptor("focusTraversable", facebean.FaceBean.class, "isFocusTraversable", null); // NOI18N properties[PROPERTY_focusTraversable].setHidden(true); properties[PROPERTY_focusTraversalKeys] = new IndexedPropertyDescriptor("focusTraversalKeys", facebean.FaceBean.class, null, null, null, "setFocusTraversalKeys"); // NOI18N properties[PROPERTY_focusTraversalKeys].setHidden(true); properties[PROPERTY_focusTraversalKeysEnabled] = new PropertyDescriptor("focusTraversalKeysEnabled", facebean.FaceBean.class, "getFocusTraversalKeysEnabled", "setFocusTraversalKeysEnabled"); // NOI18N properties[PROPERTY_focusTraversalKeysEnabled].setHidden(true); properties[PROPERTY_focusTraversalPolicy] = new PropertyDescriptor("focusTraversalPolicy", facebean.FaceBean.class, "getFocusTraversalPolicy", "setFocusTraversalPolicy"); // NOI18N properties[PROPERTY_focusTraversalPolicy].setHidden(true); properties[PROPERTY_focusTraversalPolicyProvider] = new PropertyDescriptor( "focusTraversalPolicyProvider", facebean.FaceBean.class, "isFocusTraversalPolicyProvider", "setFocusTraversalPolicyProvider"); // NOI18N properties[PROPERTY_focusTraversalPolicyProvider].setHidden(true); properties[PROPERTY_focusTraversalPolicySet] = new PropertyDescriptor("focusTraversalPolicySet", facebean.FaceBean.class, "isFocusTraversalPolicySet", null); // NOI18N properties[PROPERTY_focusTraversalPolicySet].setHidden(true); properties[PROPERTY_font] = new PropertyDescriptor("font", facebean.FaceBean.class, "getFont", "setFont"); // NOI18N properties[PROPERTY_font].setHidden(true); properties[PROPERTY_fontSet] = new PropertyDescriptor("fontSet", facebean.FaceBean.class, "isFontSet", null); // NOI18N properties[PROPERTY_fontSet].setHidden(true); properties[PROPERTY_foreground] = new PropertyDescriptor("foreground", facebean.FaceBean.class, "getForeground", "setForeground"); // NOI18N properties[PROPERTY_foreground].setPreferred(true); properties[PROPERTY_foregroundSet] = new PropertyDescriptor("foregroundSet", facebean.FaceBean.class, "isForegroundSet", null); // NOI18N properties[PROPERTY_foregroundSet].setHidden(true); properties[PROPERTY_graphics] = new PropertyDescriptor("graphics", facebean.FaceBean.class, "getGraphics", null); // NOI18N properties[PROPERTY_graphics].setHidden(true); properties[PROPERTY_graphicsConfiguration] = new PropertyDescriptor("graphicsConfiguration", facebean.FaceBean.class, "getGraphicsConfiguration", null); // NOI18N properties[PROPERTY_graphicsConfiguration].setHidden(true); properties[PROPERTY_height] = new PropertyDescriptor("height", facebean.FaceBean.class, "getHeight", null); // NOI18N properties[PROPERTY_height].setHidden(true); properties[PROPERTY_hierarchyBoundsListeners] = new PropertyDescriptor("hierarchyBoundsListeners", facebean.FaceBean.class, "getHierarchyBoundsListeners", null); // NOI18N properties[PROPERTY_hierarchyBoundsListeners].setHidden(true); properties[PROPERTY_hierarchyListeners] = new PropertyDescriptor("hierarchyListeners", facebean.FaceBean.class, "getHierarchyListeners", null); // NOI18N properties[PROPERTY_hierarchyListeners].setHidden(true); properties[PROPERTY_ignoreRepaint] = new PropertyDescriptor("ignoreRepaint", facebean.FaceBean.class, "getIgnoreRepaint", "setIgnoreRepaint"); // NOI18N properties[PROPERTY_ignoreRepaint].setHidden(true); properties[PROPERTY_inheritsPopupMenu] = new PropertyDescriptor("inheritsPopupMenu", facebean.FaceBean.class, "getInheritsPopupMenu", "setInheritsPopupMenu"); // NOI18N properties[PROPERTY_inheritsPopupMenu].setHidden(true); properties[PROPERTY_inputContext] = new PropertyDescriptor("inputContext", facebean.FaceBean.class, "getInputContext", null); // NOI18N properties[PROPERTY_inputContext].setHidden(true); properties[PROPERTY_inputMap] = new PropertyDescriptor("inputMap", facebean.FaceBean.class, "getInputMap", null); // NOI18N properties[PROPERTY_inputMap].setHidden(true); properties[PROPERTY_inputMethodListeners] = new PropertyDescriptor("inputMethodListeners", facebean.FaceBean.class, "getInputMethodListeners", null); // NOI18N properties[PROPERTY_inputMethodListeners].setHidden(true); properties[PROPERTY_inputMethodRequests] = new PropertyDescriptor("inputMethodRequests", facebean.FaceBean.class, "getInputMethodRequests", null); // NOI18N properties[PROPERTY_inputMethodRequests].setHidden(true); properties[PROPERTY_inputVerifier] = new PropertyDescriptor("inputVerifier", facebean.FaceBean.class, "getInputVerifier", "setInputVerifier"); // NOI18N properties[PROPERTY_inputVerifier].setHidden(true); properties[PROPERTY_insets] = new PropertyDescriptor("insets", facebean.FaceBean.class, "getInsets", null); // NOI18N properties[PROPERTY_insets].setHidden(true); properties[PROPERTY_keyListeners] = new PropertyDescriptor("keyListeners", facebean.FaceBean.class, "getKeyListeners", null); // NOI18N properties[PROPERTY_keyListeners].setHidden(true); properties[PROPERTY_layout] = new PropertyDescriptor("layout", facebean.FaceBean.class, "getLayout", "setLayout"); // NOI18N properties[PROPERTY_layout].setHidden(true); properties[PROPERTY_lightweight] = new PropertyDescriptor("lightweight", facebean.FaceBean.class, "isLightweight", null); // NOI18N properties[PROPERTY_lightweight].setHidden(true); properties[PROPERTY_locale] = new PropertyDescriptor("locale", facebean.FaceBean.class, "getLocale", "setLocale"); // NOI18N properties[PROPERTY_locale].setHidden(true); properties[PROPERTY_location] = new PropertyDescriptor("location", facebean.FaceBean.class, "getLocation", "setLocation"); // NOI18N properties[PROPERTY_location].setHidden(true); properties[PROPERTY_locationOnScreen] = new PropertyDescriptor("locationOnScreen", facebean.FaceBean.class, "getLocationOnScreen", null); // NOI18N properties[PROPERTY_locationOnScreen].setHidden(true); properties[PROPERTY_managingFocus] = new PropertyDescriptor("managingFocus", facebean.FaceBean.class, "isManagingFocus", null); // NOI18N properties[PROPERTY_managingFocus].setHidden(true); properties[PROPERTY_maximumSize] = new PropertyDescriptor("maximumSize", facebean.FaceBean.class, "getMaximumSize", "setMaximumSize"); // NOI18N properties[PROPERTY_maximumSize].setHidden(true); properties[PROPERTY_maximumSizeSet] = new PropertyDescriptor("maximumSizeSet", facebean.FaceBean.class, "isMaximumSizeSet", null); // NOI18N properties[PROPERTY_maximumSizeSet].setHidden(true); properties[PROPERTY_minimumSize] = new PropertyDescriptor("minimumSize", facebean.FaceBean.class, "getMinimumSize", "setMinimumSize"); // NOI18N properties[PROPERTY_minimumSize].setHidden(true); properties[PROPERTY_minimumSizeSet] = new PropertyDescriptor("minimumSizeSet", facebean.FaceBean.class, "isMinimumSizeSet", null); // NOI18N properties[PROPERTY_minimumSizeSet].setHidden(true); properties[PROPERTY_mouseListeners] = new PropertyDescriptor("mouseListeners", facebean.FaceBean.class, "getMouseListeners", null); // NOI18N properties[PROPERTY_mouseListeners].setHidden(true); properties[PROPERTY_mouseMotionListeners] = new PropertyDescriptor("mouseMotionListeners", facebean.FaceBean.class, "getMouseMotionListeners", null); // NOI18N properties[PROPERTY_mouseMotionListeners].setHidden(true); properties[PROPERTY_mousePosition] = new PropertyDescriptor("mousePosition", facebean.FaceBean.class, "getMousePosition", null); // NOI18N properties[PROPERTY_mousePosition].setHidden(true); properties[PROPERTY_mouseWheelListeners] = new PropertyDescriptor("mouseWheelListeners", facebean.FaceBean.class, "getMouseWheelListeners", null); // NOI18N properties[PROPERTY_mouseWheelListeners].setHidden(true); properties[PROPERTY_mouthWidth] = new PropertyDescriptor("mouthWidth", facebean.FaceBean.class, "getMouthWidth", "setMouthWidth"); // NOI18N properties[PROPERTY_mouthWidth].setPreferred(true); properties[PROPERTY_name] = new PropertyDescriptor("name", facebean.FaceBean.class, "getName", "setName"); // NOI18N properties[PROPERTY_name].setHidden(true); properties[PROPERTY_nextFocusableComponent] = new PropertyDescriptor("nextFocusableComponent", facebean.FaceBean.class, "getNextFocusableComponent", "setNextFocusableComponent"); // NOI18N properties[PROPERTY_nextFocusableComponent].setHidden(true); properties[PROPERTY_opaque] = new PropertyDescriptor("opaque", facebean.FaceBean.class, "isOpaque", "setOpaque"); // NOI18N properties[PROPERTY_opaque].setHidden(true); properties[PROPERTY_optimizedDrawingEnabled] = new PropertyDescriptor("optimizedDrawingEnabled", facebean.FaceBean.class, "isOptimizedDrawingEnabled", null); // NOI18N properties[PROPERTY_optimizedDrawingEnabled].setHidden(true); properties[PROPERTY_paintingForPrint] = new PropertyDescriptor("paintingForPrint", facebean.FaceBean.class, "isPaintingForPrint", null); // NOI18N properties[PROPERTY_paintingForPrint].setHidden(true); properties[PROPERTY_paintingTile] = new PropertyDescriptor("paintingTile", facebean.FaceBean.class, "isPaintingTile", null); // NOI18N properties[PROPERTY_paintingTile].setHidden(true); properties[PROPERTY_parent] = new PropertyDescriptor("parent", facebean.FaceBean.class, "getParent", null); // NOI18N properties[PROPERTY_parent].setHidden(true); properties[PROPERTY_peer] = new PropertyDescriptor("peer", facebean.FaceBean.class, "getPeer", null); // NOI18N properties[PROPERTY_peer].setHidden(true); properties[PROPERTY_preferredSize] = new PropertyDescriptor("preferredSize", facebean.FaceBean.class, "getPreferredSize", "setPreferredSize"); // NOI18N properties[PROPERTY_preferredSize].setHidden(true); properties[PROPERTY_preferredSizeSet] = new PropertyDescriptor("preferredSizeSet", facebean.FaceBean.class, "isPreferredSizeSet", null); // NOI18N properties[PROPERTY_preferredSizeSet].setHidden(true); properties[PROPERTY_propertyChangeListeners] = new PropertyDescriptor("propertyChangeListeners", facebean.FaceBean.class, "getPropertyChangeListeners", null); // NOI18N properties[PROPERTY_propertyChangeListeners].setHidden(true); properties[PROPERTY_registeredKeyStrokes] = new PropertyDescriptor("registeredKeyStrokes", facebean.FaceBean.class, "getRegisteredKeyStrokes", null); // NOI18N properties[PROPERTY_registeredKeyStrokes].setHidden(true); properties[PROPERTY_requestFocusEnabled] = new PropertyDescriptor("requestFocusEnabled", facebean.FaceBean.class, "isRequestFocusEnabled", "setRequestFocusEnabled"); // NOI18N properties[PROPERTY_requestFocusEnabled].setHidden(true); properties[PROPERTY_rootPane] = new PropertyDescriptor("rootPane", facebean.FaceBean.class, "getRootPane", null); // NOI18N properties[PROPERTY_rootPane].setHidden(true); properties[PROPERTY_showing] = new PropertyDescriptor("showing", facebean.FaceBean.class, "isShowing", null); // NOI18N properties[PROPERTY_showing].setHidden(true); properties[PROPERTY_size] = new PropertyDescriptor("size", facebean.FaceBean.class, "getSize", "setSize"); // NOI18N properties[PROPERTY_size].setHidden(true); properties[PROPERTY_toolkit] = new PropertyDescriptor("toolkit", facebean.FaceBean.class, "getToolkit", null); // NOI18N properties[PROPERTY_toolkit].setHidden(true); properties[PROPERTY_toolTipText] = new PropertyDescriptor("toolTipText", facebean.FaceBean.class, "getToolTipText", "setToolTipText"); // NOI18N properties[PROPERTY_toolTipText].setHidden(true); properties[PROPERTY_topLevelAncestor] = new PropertyDescriptor("topLevelAncestor", facebean.FaceBean.class, "getTopLevelAncestor", null); // NOI18N properties[PROPERTY_topLevelAncestor].setHidden(true); properties[PROPERTY_transferHandler] = new PropertyDescriptor("transferHandler", facebean.FaceBean.class, "getTransferHandler", "setTransferHandler"); // NOI18N properties[PROPERTY_transferHandler].setHidden(true); properties[PROPERTY_treeLock] = new PropertyDescriptor("treeLock", facebean.FaceBean.class, "getTreeLock", null); // NOI18N properties[PROPERTY_treeLock].setHidden(true); properties[PROPERTY_UIClassID] = new PropertyDescriptor("UIClassID", facebean.FaceBean.class, "getUIClassID", null); // NOI18N properties[PROPERTY_UIClassID].setHidden(true); properties[PROPERTY_valid] = new PropertyDescriptor("valid", facebean.FaceBean.class, "isValid", null); // NOI18N properties[PROPERTY_valid].setHidden(true); properties[PROPERTY_validateRoot] = new PropertyDescriptor("validateRoot", facebean.FaceBean.class, "isValidateRoot", null); // NOI18N properties[PROPERTY_validateRoot].setHidden(true); properties[PROPERTY_verifyInputWhenFocusTarget] = new PropertyDescriptor("verifyInputWhenFocusTarget", facebean.FaceBean.class, "getVerifyInputWhenFocusTarget", "setVerifyInputWhenFocusTarget"); // NOI18N properties[PROPERTY_verifyInputWhenFocusTarget].setHidden(true); properties[PROPERTY_vetoableChangeListeners] = new PropertyDescriptor("vetoableChangeListeners", facebean.FaceBean.class, "getVetoableChangeListeners", null); // NOI18N properties[PROPERTY_vetoableChangeListeners].setHidden(true); properties[PROPERTY_visible] = new PropertyDescriptor("visible", facebean.FaceBean.class, "isVisible", "setVisible"); // NOI18N properties[PROPERTY_visible].setHidden(true); properties[PROPERTY_visibleRect] = new PropertyDescriptor("visibleRect", facebean.FaceBean.class, "getVisibleRect", null); // NOI18N properties[PROPERTY_visibleRect].setHidden(true); properties[PROPERTY_width] = new PropertyDescriptor("width", facebean.FaceBean.class, "getWidth", null); // NOI18N properties[PROPERTY_width].setHidden(true); properties[PROPERTY_x] = new PropertyDescriptor("x", facebean.FaceBean.class, "getX", null); // NOI18N properties[PROPERTY_x].setHidden(true); properties[PROPERTY_y] = new PropertyDescriptor("y", facebean.FaceBean.class, "getY", null); // NOI18N properties[PROPERTY_y].setHidden(true); } catch (IntrospectionException e) { e.printStackTrace(); } //GEN-HEADEREND:Properties // Here you can add code for customizing the properties array. return properties; }
From source file:com.metaparadigm.jsonrpc.BeanSerializer.java
public Object unmarshall(SerializerState state, Class clazz, Object o) throws UnmarshallException { JSONObject jso = (JSONObject) o;// w w w.ja v a2 s.c o m BeanData bd = null; try { bd = getBeanData(clazz); } catch (IntrospectionException e) { throw new UnmarshallException(clazz.getName() + " is not a bean"); } if (ser.isDebug()) log.fine("instantiating " + clazz.getName()); Object instance = null; try { instance = clazz.newInstance(); } catch (Exception e) { throw new UnmarshallException("can't instantiate bean " + clazz.getName() + ": " + e.getMessage()); } Object invokeArgs[] = new Object[1]; Object fieldVal = null; Iterator i = jso.keys(); while (i.hasNext()) { String field = (String) i.next(); Method setMethod = (Method) bd.writableProps.get(field); if (setMethod != null) { try { Class param[] = setMethod.getParameterTypes(); fieldVal = ser.unmarshall(state, param[0], jso.get(field)); } catch (UnmarshallException e) { throw new UnmarshallException("bean " + clazz.getName() + " " + e.getMessage()); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (ser.isDebug()) log.fine("invoking " + setMethod.getName() + "(" + fieldVal + ")"); invokeArgs[0] = fieldVal; try { setMethod.invoke(instance, invokeArgs); } catch (Throwable e) { if (e instanceof InvocationTargetException) e = ((InvocationTargetException) e).getTargetException(); throw new UnmarshallException("bean " + clazz.getName() + "can't invoke " + setMethod.getName() + ": " + e.getMessage()); } } } return instance; }
From source file:de.terrestris.shogun.dao.DatabaseDao.java
private Criteria setEagerFetchModeForCollections(Criteria criteria, Class<?> clazz) { List<Field> fields = getAllFields(new ArrayList<Field>(), clazz); for (Field field : fields) { boolean isJsonIgnore = false; Method getterMethod;//from w w w . ja v a2 s.c om try { getterMethod = new PropertyDescriptor(field.getName(), clazz).getReadMethod(); Annotation[] anoArr = getterMethod.getAnnotations(); for (Annotation annotation : anoArr) { if (annotation instanceof JsonIgnore) { isJsonIgnore = true; } } } catch (IntrospectionException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (!isJsonIgnore && field.getType().isAssignableFrom(Set.class)) { // yes, we have to set the fetch mode criteria.setFetchMode(field.getName(), FetchMode.JOIN); } } return criteria; }