Originally Posted by vinodvadde
Personally I think storing object repository in Excel is shooting yourself in the foot. In the Java world you have nice re-factoring tools like IntelliJ. With simple keyboard shortcuts you can easily mass rename a variable or property, and have all referencing files also be updated in the same way to prevent breaking your code. It also has safe delete, so you don't accidentally delete needed properties.
As for your question. The @findBy is what we call in the programming world a Decorator Pattern. But java calls them 'annotations' which makes it a bit confusing because developers call them decorators. In order to load the properties from excel, what you'll want to do is create your own decorator,
Declaring an Annotation Type (The Java™ Tutorials > Learning the Java Language > Annotations)
@MyFrameworkFindBy("excel row key")
How it all works is quite complicate. Think of an @Annotation as a way to at compile time replace the decorated code with a wrapped code.
As you can see the @findBy through some complicated ninja coding, will replace your @findBy(...) IWebElement myElement; will add a new initiation method into the compiled code (that's hidden from your view) that'll initialize those elements when you construct the page object using the PageFactory class.