Package js.lang

Examples of js.lang.NativeObject.keys()


        if (enumerationConstants == null) {
            enumerationConstants = new HashMap();

            NativeObject definition = prototype.getPropertyAs(NativeObject.class, "$");

            for (String name : definition.keys()) {
                NativeObject value = definition.getPropertyAs(NativeObject.class, name);

                if (value.isArray()) {
                    for (Enum item : (Enum[]) (Object) value) {
                        enumerationConstants.put(item.name(), item);
View Full Code Here


            for (String index : annotations.keys()) {
                List<Annotation> container = new ArrayList();
                NativeObject definition = annotations.getProperty(index, new NativeObject());

                for (String name : definition.keys()) {
                    Class type = JSClass.forName(name);

                    container.add((Annotation) Proxy.newProxyInstance(null, new Class[] {type}, new AnnotationProxy(type, definition.getProperty(name))));
                }
                parameterAnnotations.setProperty(index, container);
View Full Code Here

                Object key1 = "1";
                Object key2 = "2";
                Object key3 = "3";

                NativeObject instance = new NativeObject();
                NativeArray<String> set1 = new NativeArray(instance.keys());
                assert set1.length() == 0;

                Object value1 = instance.setProperty(key1, "value1");
                Object value2 = instance.setProperty(key2, "value2");
                Object value3 = instance.setProperty(key3, "value3");
View Full Code Here

                Object value1 = instance.setProperty(key1, "value1");
                Object value2 = instance.setProperty(key2, "value2");
                Object value3 = instance.setProperty(key3, "value3");

                NativeArray<String> set2 = new NativeArray(instance.keys());
                assert set2.length() == 3;
                assert set2.indexOf(key1) != -1;
                assert set2.indexOf(key2) != -1;
                assert set2.indexOf(key3) != -1;
                assert set2.indexOf("4") == -1;
View Full Code Here

                assert set2.indexOf("4") == -1;

                instance.deleteProperty(key1);
                instance.deleteProperty(key3);

                NativeArray<String> set3 = new NativeArray(instance.keys());
                assert set3.length() == 1;
                assert set3.indexOf(key1) == -1;
                assert set3.indexOf(key2) != -1;
                assert set3.indexOf(key3) == -1;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.