Thread:
 small code comment 
 stewart.cambridge   22 Mar 2006, 07:35 
 Re: small code comment 
 raghavender   29 May 2006, 07:05 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: stewart.cambridge (22 Mar 2006, 07:35) Replies: 1, Views: 25879
Subject: small code comment
Where you do this:

            Class objectClass = obj.getClass();
            String className = objectClass.getName();

            // Just get the class name without the package structure 
            String[] tokens = className.split("\\.");
            int lastToken = tokens.length - 1;
            className = tokens[lastToken];

You just do this:

            Class objectClass = obj.getClass();
            String className = objectClass.getSimpleName();
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]