Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 373597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:19:25+00:00 2026-05-12T14:19:25+00:00

If I have a package (foo.bar), is there some groovy sugar that makes it

  • 0

If I have a package (foo.bar), is there some groovy sugar that makes it easy for me to enumerate all the classes in said package?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:19:25+00:00Added an answer on May 12, 2026 at 2:19 pm

    Groovy is built on top of Java so when it comes to class loading, any Groovy class is just a Java class. Java does not provide a way to do what you are looking for. You would think it would be a method on http://java.sun.com/javase/6/docs/api/java/lang/Package.html but there is not anything to list the classes.

    There is a way you can do it if you really need though. Classes are just files on disk. Listing the files that end in .class would give you the list of Java classes. If you are looking for the contents of a Jar file (which is just a zip, see this for reading jars), you can open the jar and look at each class in the archive. Directory structure always corresponds to the package structure so it should not be hard to take a package you are looking for and list all .class files in that directory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have data naively collected from package dependency lists. Depends: foo bar baz >=
Say I have a package called Foo organized this way: Foo\ __init__.py foo.py bar.py
I have a package that I just made and I have an old-mode that
I have a package with logic classes(like CheckAuthenticationDataLogic.java, GetVocabulariesLogic.java). And another class - ApiService.java
I have a dtsx package with a precedence constraint that evaluates an expression and
I have a DTS package that drops a table then creates it and populates
I have several C and C++ projects that all follow a basic structure I've
I have following files and directories in my project root directory main.py bar.py foo
I have a holder movieclip, its base class is foo. package { import flash.display.MovieClip;
Assume a class Foo , with a dependency Bar which is injected by some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.