Package java.beans

Examples of java.beans.DefaultPersistenceDelegate


        });

        try {
            final Object object = new Object();
            e.setPersistenceDelegate(AType.class,
                    new DefaultPersistenceDelegate() {
                        @SuppressWarnings("unchecked")
                        @Override
                        protected void initialize(Class type,
                                Object oldInstance, Object newInstance,
                                Encoder out) {
View Full Code Here


    /*
     * Test the method getValue() with a protected method but within java.beans
     * package.
     */
    public void testGetValue_ProtectedMethodWithPackage() throws Exception {
        DefaultPersistenceDelegate dpd = new DefaultPersistenceDelegate();
        Object[] arguments = new Object[] { "test", "test" };
        Expression t = new Expression(dpd, "mutatesTo", arguments);
        try {
            t.getValue();
            fail("Should throw NoSuchMethodException!");
View Full Code Here

        });

        try {
            final Object object = new Object();
            e.setPersistenceDelegate(AType.class,
                    new DefaultPersistenceDelegate() {
                        @SuppressWarnings("unchecked")
                        @Override
                        protected void initialize(Class type,
                                Object oldInstance, Object newInstance,
                                Encoder out) {
View Full Code Here

        });

        try {
            final Object object = new Object();
            e.setPersistenceDelegate(AType.class,
                    new DefaultPersistenceDelegate() {
                        @SuppressWarnings("unchecked")
                        @Override
                        protected void initialize(Class type,
                                Object oldInstance, Object newInstance,
                                Encoder out) {
View Full Code Here

    /*
     * Test the default constructor.
     */
    public void testConstructor_Default() {
        new DefaultPersistenceDelegate();
    }
View Full Code Here

    /*
     * Test the constructor with normal property names.
     */
    public void testConstructor_StringArray_Normal() {
        new DefaultPersistenceDelegate(new String[] { "prop1", "", null });
    }
View Full Code Here

    /*
     * Test the constructor with an empty string array.
     */
    public void testConstructor_StringArray_Empty() {
        new DefaultPersistenceDelegate(new String[0]);
    }
View Full Code Here

    /*
     * Test the constructor with null.
     */
    public void testConstructor_StringArray_Null() {
        new DefaultPersistenceDelegate(null);
    }
View Full Code Here

     * - enhanced sort-related table state (?)
     */
    public void registerPersistenceDelegates() {
        XMLEncoder encoder = new XMLEncoder(System.out);
        encoder.setPersistenceDelegate(SortKeyState.class,
                new DefaultPersistenceDelegate(new String[] { "ascending",
                        "modelIndex"}));
        encoder.setPersistenceDelegate(ColumnState.class,
                new DefaultPersistenceDelegate(
                        new String[] { "width", "preferredWidth", "modelIndex",
                                "visible", "viewIndex" }));
        encoder.setPersistenceDelegate(XTableState.class,
                new DefaultPersistenceDelegate(new String[] { "columnStates",
                        "sortKeyState", "horizontalScrollEnabled" }));
    }
View Full Code Here

     */
    public static String createSystemStateString(DataBaseModel model) {
        try {
            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
            XMLEncoder xmlEncoder = new XMLEncoder(outputStream);
            xmlEncoder.setPersistenceDelegate(ActionModel.class, new DefaultPersistenceDelegate(new String[]{"actions","id"}));
            xmlEncoder.setPersistenceDelegate(ActionTupel.class, new DefaultPersistenceDelegate(new String[]{"algorithm","mode"}));
            xmlEncoder.writeObject(model);
            xmlEncoder.close();
            outputStream.close();

            return outputStream.toString();
View Full Code Here

TOP

Related Classes of java.beans.DefaultPersistenceDelegate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.