Java Code Examples for java.beans.IntrospectionException.printStackTrace()

The following are Jave code examples for showing how to use printStackTrace() of the java.beans.IntrospectionException class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: convertigo-eclipse   File: ComponentInfoWizardPage.java   Source Code and License Vote up 6 votes
@Override
public void setVisible(boolean visible) {
	// TODO Auto-generated method stub
	super.setVisible(visible);
	
	if (visible) {
		ComponentExplorerWizardPage objectExplorerWizardPage = (ComponentExplorerWizardPage) this.getPreviousPage(); 
		
		try {
			Object o = objectExplorerWizardPage.getCreatedBean();
			if (o instanceof AbstractCouchDbTransaction) {
				AbstractCouchDbTransaction dbo = (AbstractCouchDbTransaction) objectExplorerWizardPage.getCreatedBean();
				if (dbo != null && couchVariablesComposite != null){
					couchVariablesComposite.setPropertyDescriptor(dbo, CachedIntrospector.getBeanInfo(dbo).getPropertyDescriptors(), 
							(DatabaseObject) parentObject);
				}
			}
		} catch (IntrospectionException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
 
Example 2
Project: convertigo-eclipse   File: ObjectInfoWizardPage.java   Source Code and License Vote up 6 votes
@Override
public void setVisible(boolean visible) {
	// TODO Auto-generated method stub
	super.setVisible(visible);
	
	if (visible) {
		ObjectExplorerWizardPage objectExplorerWizardPage = (ObjectExplorerWizardPage) this.getPreviousPage(); 
		
		try {
			Object o = objectExplorerWizardPage.getCreatedBean();
			if (o instanceof AbstractCouchDbTransaction) {
				AbstractCouchDbTransaction dbo = (AbstractCouchDbTransaction) objectExplorerWizardPage.getCreatedBean();
				if (dbo != null && couchVariablesComposite != null){
					couchVariablesComposite.setPropertyDescriptor(dbo, CachedIntrospector.getBeanInfo(dbo).getPropertyDescriptors(), 
							(DatabaseObject) parentObject);
				}
			}
		} catch (IntrospectionException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
 
Example 3
Project: etomica   File: ObjectWrapper.java   Source Code and License Vote up 6 votes
public ObjectWrapper(T wrapped, SimulationModel simModel, boolean doSerialize) {
    super(wrapped, simModel, doSerialize);
    List<Property> properties = new ArrayList<>();
    try {
        Arrays.stream(Introspector.getBeanInfo(wrappedClass).getPropertyDescriptors())
                .filter(propertyDescriptor -> !propertyDescriptor.getName().equalsIgnoreCase("class"))
                .filter(propertyDescriptor -> propertyDescriptorMethod(propertyDescriptor) != null)
                .filter(propertyDescriptor -> !hasAnnotation(propertyDescriptorMethod(propertyDescriptor), IgnoreProperty.class))
                .filter(propertyDescriptor -> !hasAnnotation(propertyDescriptorMethod(propertyDescriptor), JsonIgnore.class))
                .filter(propertyDescriptor -> !propertyDescriptor.getName().toLowerCase().endsWith("dimension"))
                .forEach(propertyDescriptor -> properties.add(makeProperty(wrapped, propertyDescriptor)));

        for (Property p : properties) {
            if (p.isValueProperty()) {
                valueProps.add(p);
            } else {
                childProps.add(p);
            }
        }
    } catch (IntrospectionException e) {
        e.printStackTrace();
    }
}
 
Example 4
Project: jdk8u-jdk   File: Test4634390.java   Source Code and License Vote up 6 votes
private static PropertyDescriptor create(PropertyDescriptor pd) {
    try {
        if (pd instanceof IndexedPropertyDescriptor) {
            IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
            return new IndexedPropertyDescriptor(
                    ipd.getName(),
                    ipd.getReadMethod(),
                    ipd.getWriteMethod(),
                    ipd.getIndexedReadMethod(),
                    ipd.getIndexedWriteMethod());
        } else {
            return new PropertyDescriptor(
                    pd.getName(),
                    pd.getReadMethod(),
                    pd.getWriteMethod());
        }
    }
    catch (IntrospectionException exception) {
        exception.printStackTrace();
        return null;
    }
}
 
Example 5
Project: openjdk-jdk10   File: TestBeanInfoPriority.java   Source Code and License Vote up 6 votes
@Override
public EventSetDescriptor[] getEventSetDescriptors() {
    EventSetDescriptor[] es = new EventSetDescriptor[2];
    try {
        es[iAction] = new EventSetDescriptor(
                TestClass.class,
                "actionListener",
                java.awt.event.ActionListener.class,
                new String[] {"actionPerformed"},
                "addActionListener",
                "removeActionListener");
        es[iMouse] = new EventSetDescriptor(
                TestClass.class,
                "mouseListener",
                java.awt.event.MouseListener.class,
                new String[] {"mouseClicked", "mousePressed", "mouseReleased", "mouseEntered", "mouseExited"},
                "addMouseListener",
                "removeMouseListener");
    } catch(IntrospectionException e) {
        e.printStackTrace();
    }
    return es;
}
 
Example 6
Project: openjdk-jdk10   File: OverrideUserDefPropertyInfoTest.java   Source Code and License Vote up 6 votes
@Override
public PropertyDescriptor[] getPropertyDescriptors() {
    PropertyDescriptor[] p = new PropertyDescriptor[1];

    try {
        p[0] = new PropertyDescriptor ("x", Base.class, "getX", null);
        p[0].setShortDescription("BASEPROPERTY");
        p[0].setBound (baseFlag);
        p[0].setExpert(baseFlag);
        p[0].setHidden(baseFlag);
        p[0].setPreferred(baseFlag);
        p[0].setValue("required", baseFlag);
        p[0].setValue("visualUpdate", baseFlag);
        p[0].setValue("enumerationValues",
            new Object[]{"TOP", 1, "javax.swing.SwingConstants.TOP"});
    } catch(IntrospectionException e) { e.printStackTrace(); }

    return p;
}
 
Example 7
Project: openjdk-jdk10   File: Test4634390.java   Source Code and License Vote up 6 votes
private static PropertyDescriptor create(PropertyDescriptor pd) {
    try {
        if (pd instanceof IndexedPropertyDescriptor) {
            IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
            return new IndexedPropertyDescriptor(
                    ipd.getName(),
                    ipd.getReadMethod(),
                    ipd.getWriteMethod(),
                    ipd.getIndexedReadMethod(),
                    ipd.getIndexedWriteMethod());
        } else {
            return new PropertyDescriptor(
                    pd.getName(),
                    pd.getReadMethod(),
                    pd.getWriteMethod());
        }
    }
    catch (IntrospectionException exception) {
        exception.printStackTrace();
        return null;
    }
}
 
Example 8
Project: incubator-netbeans   File: LanguagesDataLoaderBeanInfo.java   Source Code and License Vote up 5 votes
public PropertyDescriptor[] getPropertyDescriptors() {
    System.out.println("LanguagesDataLoaderBeanInfo.getPropertyDescriptors");
    try {
        PropertyDescriptor[] pds = new PropertyDescriptor[] {
            new PropertyDescriptor ("NBSFiles", LanguagesDataLoader.class, "getNBSFiles", null),
        };
        pds [0].setDisplayName ("GLF Files");
        pds [0].setBound (true);
        pds [0].setPropertyEditorClass (ActionsEditor.class);
        return pds;
    } catch (IntrospectionException ie) {
        ie.printStackTrace();
        return new PropertyDescriptor[0];
    }
}
 
Example 9
Project: convertigo-eclipse   File: CouchVariablesDialog.java   Source Code and License Vote up 5 votes
@Override
protected Control createDialogArea(Composite parent) {	
	try {
		PropertyDescriptor[] availablesParameters = null;
		List<RequestableVariable> dboVariables = null;
		if (props != null) {
			availablesParameters = props;
		} else {
			availablesParameters = CachedIntrospector.getBeanInfo(couchDbTransaction).getPropertyDescriptors();
		}
		
		if (couchDbTransaction != null) {
			dboVariables = couchDbTransaction.getVariablesList();
		}
		
		couchVariablesComposite = new CouchVariablesComposite(parent, SWT.V_SCROLL, dboVariables);
		couchVariablesComposite.setPropertyDescriptor(couchDbTransaction, availablesParameters, couchDbTransaction.getParent());

		GridData couchVarData = new GridData(GridData.FILL_BOTH);
		couchVarData.horizontalSpan = 2;

		couchVariablesComposite.setLayoutData(couchVarData);
		
		if (couchVariablesComposite.getSelectedParameters().size()==0) {
			setReturnCode(-1);
		}
		
	} catch (IntrospectionException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
	return couchVariablesComposite;
}
 
Example 10
Project: slardar   File: ReflectUtils.java   Source Code and License Vote up 5 votes
public static PropertyDescriptor[] propertyDescriptors(Class<?> c) {
    BeanInfo beanInfo = null;
    try {
        beanInfo = Introspector.getBeanInfo(c);
    } catch (IntrospectionException e) {
        e.printStackTrace();
    }

    return beanInfo.getPropertyDescriptors();
}
 
Example 11
Project: jdk8u-jdk   File: AttributeArbitraryDataTypeTest.java   Source Code and License Vote up 5 votes
public PropertyDescriptor[] getPropertyDescriptors() {
    try {
        return new PropertyDescriptor[] {
            new PropertyDescriptor("name", Match.class, "name", null) };
    } catch (IntrospectionException e ) {
        e.printStackTrace();
        return null;
    }
}
 
Example 12
Project: openjdk-jdk10   File: AttributeArbitraryDataTypeTest.java   Source Code and License Vote up 5 votes
public PropertyDescriptor[] getPropertyDescriptors() {
    try {
        return new PropertyDescriptor[] {
            new PropertyDescriptor("name", Match.class, "name", null) };
    } catch (IntrospectionException e ) {
        e.printStackTrace();
        return null;
    }
}
 
Example 13
Project: bubichain-sdk-java   File: PojoPropertiesConverter.java   Source Code and License Vote up 5 votes
public PojoPropertiesConverter(Class<?> argType){
    this.argType = argType;
    try {
        resolveParamProperties();
    } catch (IntrospectionException e) {
        e.printStackTrace();
    }
}
 
Example 14
Project: openjdk-jdk10   File: TestBeanInfoPriority.java   Source Code and License Vote up 4 votes
@Override
public PropertyDescriptor[] getPropertyDescriptors() {

    PropertyDescriptor[] p = new PropertyDescriptor[2];

    try {

        // value
        PropertyDescriptor pdValue = new PropertyDescriptor(
            "value", TestClass.class, "getValue", "setValue");
        pdValue.setBound(true);
        pdValue.setConstrained(true);
        pdValue.setExpert(true);
        pdValue.setHidden(true);
        pdValue.setPreferred(true);
        pdValue.setValue("required", true);
        pdValue.setValue("visualUpdate", true);
        pdValue.setShortDescription("user-defined-value");
        pdValue.setValue("enumerationValues", new Object[]{
                "EAST", 3, "javax.swing.SwingConstants.EAST",
                "WEST", 7, "javax.swing.SwingConstants.WEST"});
        p[iValue] = pdValue;

        // other
        PropertyDescriptor pdOther = new PropertyDescriptor(
                "other", TestClass.class, "getOther", "setOther");
        pdOther.setBound(false);
        pdOther.setConstrained(false);
        pdOther.setExpert(false);
        pdOther.setHidden(false);
        pdOther.setPreferred(false);
        pdOther.setValue("required", false);
        pdOther.setValue("visualUpdate", false);
        pdOther.setShortDescription("user-defined-other");
        pdOther.setValue("enumerationValues", new Object[]{
                "TOP", 1, "javax.swing.SwingConstants.TOP"});
        p[iOther] = pdOther;

    } catch(IntrospectionException e) {
        e.printStackTrace();
    }

    return p;
}