Package java.util.prefs

Examples of java.util.prefs.Preferences.childrenNames()


       
        Preferences ejbNode = getInitialContextEjbNode();
       
        try
        {
            String[] childrenNames = ejbNode.childrenNames();
           
            for ( int i = 0; i < childrenNames.length; i++ )
            {
                Preferences node = ejbNode.node( childrenNames[i] );
               
View Full Code Here


      String nodeName = rootNodeName + "/testListKeys";
     
      Preferences pref = fillTree(isSystemRoot, nodeName);
      pref = getRightNode(isSystemRoot, rootNodeName);
     
      String[] keys = pref.childrenNames();
      assert keys.length == 1 : "There should only be one key in this node.";
      assert keys[0].equals("testListKeys") : "the key should be named testListKeys";
    } finally {
      MultiPreferencesFactory.setFactory(savedFactory);
    }
View Full Code Here

    {
        Preferences prefs = Preferences.userRoot();
        // Test without children.
        try
        {
            String[] childrenNames = prefs.childrenNames();
            if (childrenNames.length > 0)
            {
                assertTrue("expected no children, " + childrenNames.length + ", " + childrenNames[0],
                        childrenNames.length == 0);
            }
View Full Code Here

        removeNode.removeNode();
        assertFalse(prefs.nodeExists(test_node));
       
        try
        {
           removeNode.childrenNames();
           assertFalse("An IllegalStateException should have been thrown by the AbtractPreferences class", true);
        }
        catch (IllegalStateException e)
        {
           
View Full Code Here

        assertEquals(-1, prefs1.getLong("pd", -1));
        assertEquals("é", prefs1.get("pe", null));

        Preferences prefs2 = new PropertiesPreferences(
                makeInput("pa=1\na.pb=2\na.b.pc=3\na.b2.pd=uvw\nb.pe=42"));
        String[] children = prefs2.childrenNames();
        Arrays.sort(children);
        assertEquals("a", children[0]);
        assertEquals("b", children[1]);
        assertEquals(1, prefs2.getLong("pa", 0));
        assertEquals(2, prefs2.node("a").getLong("pb", 0));
View Full Code Here

    {
        Preferences prefs = Preferences.userRoot();
        // Test without children.
        try
        {
            String[] childrenNames = prefs.childrenNames();
            if (childrenNames.length > 0)
            {
                assertTrue("expected no children, " + childrenNames.length + ", " + childrenNames[0],
                        childrenNames.length == 0);
            }
View Full Code Here

        removeNode.removeNode();
        assertFalse(prefs.nodeExists(test_node));

        try
        {
            removeNode.childrenNames();
            assertFalse("An IllegalStateException should have been thrown by the AbtractPreferences class", true);
        }
        catch (IllegalStateException e)
        {
View Full Code Here

    private Set<String> filterCustomCRSs( Set<String> descriptions, String[] searchParms ) {
        try {
            Preferences root = Preferences.userRoot();
            Preferences node = root.node(CUSTOM_ID);

            for( String id : node.childrenNames() ) {
                Preferences child = node.node(id);
                String string = child.get(NAME_ID, null);
                if (string != null && matchesFilter(string.toUpperCase(), searchParms)) {
                    descriptions.add(string);
                    continue;
View Full Code Here

            if (node.nodeExists(code)) {
                return node.node(code);
            }

            for( String id : node.childrenNames() ) {
                Preferences child = node.node(id);
                String name = child.get(NAME_ID, null);
                if (name != null && matchesFilter(name, new String[]{code})) {
                    return child;
                }
View Full Code Here

    }

    private void loadChilds(Device device, Preferences deviceNode)
            throws BackingStoreException, ConfigurationException {
        Preferences connsNode = deviceNode.node("dcmNetworkConnection");
        for (int connIndex : sort(connsNode.childrenNames())) {
            Connection conn = newConnection();
            loadFrom(conn, connsNode.node("" + connIndex));
            device.addConnection(conn);
        }
        List<Connection> devConns = device.listConnections();
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.