DevFaqLookupContents

(Difference between revisions)
(How can I find out what is in a Lookup?)
m (How can I find out what is in a Lookup?)
Line 9: Line 9:
  }
  }
-
'''<u>Do not</u> do any of these things in production code!'''
+
'''<u>Do not</u> do either of these things in production code!'''

Revision as of 00:42, 19 February 2010

How can I find out what is in a Lookup?

The simplest way is to call Lookup.toString(). If you want the output in a more readable form, do the following and print/format the resulting collection as you wish:

Collection<?> c = theLookup.lookupAll(Object.class);
for (Object o : c) {
  //do what you want
}

Do not do either of these things in production code!

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo