Java Doc for Processor.java in  » Code-Analyzer » Spoon » spoon » processing » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Code Analyzer » Spoon » spoon.processing 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


spoon.processing.Processor

Processor
public interface Processor extends FactoryAccessor(Code)
This interface defines a generic code processor. To define a new processor, the user should subclass spoon.processing.AbstractProcessor , the abstract default implementation of this interface.




Method Summary
 EnvironmentgetEnvironment()
     Gets the environment of this processor.
 Set<Class<? extends CtElement>>getProcessedElementTypes()
     Gets all the element types than need to be processed.
 TraversalStrategygetTraversalStrategy()
     Gets the model's traversal strategy for this processor (default is TraversalStrategy.PRE_ORDER ).
 voidinit()
     This method is upcalled to initialize the processor before each processing round.
 voidinitProperties(ProcessorProperties properties)
     Initializes the properties defined by this processor by using the environment.
 booleanisToBeProcessed(E candidate)
     Tells if this element is to be processed (returns true in the default implementation).
 voidprocess(E element)
     A callback method upcalled by the meta-model scanner to perform a dedicated job on the currently scanned element.
 voidprocess()
     A callback method upcalled by the manager so that this processor can manually implement a processing job.
 voidprocessingDone()
     This method is upcalled by the ProcessingManager when this processor has finished a full processing round on the program's model.



Method Detail
getEnvironment
Environment getEnvironment()(Code)
Gets the environment of this processor.



getProcessedElementTypes
Set<Class<? extends CtElement>> getProcessedElementTypes()(Code)
Gets all the element types than need to be processed.



getTraversalStrategy
TraversalStrategy getTraversalStrategy()(Code)
Gets the model's traversal strategy for this processor (default is TraversalStrategy.PRE_ORDER ). Programmers should override this method to return another strategy if needed.



init
void init()(Code)
This method is upcalled to initialize the processor before each processing round. It is convenient to override this method rather than using a default constructor to initialize the processor, since the factory is not initialized at construction time. When overriding, do not forget to call super.init() first so that all the initializations performed by superclasses are also applied.



initProperties
void initProperties(ProcessorProperties properties)(Code)
Initializes the properties defined by this processor by using the environment.
See Also:   Environment.getProcessorProperties(String)



isToBeProcessed
boolean isToBeProcessed(E candidate)(Code)
Tells if this element is to be processed (returns true in the default implementation).
Parameters:
  candidate - the candidate true if the candidate is to be processed by theProcessor.process(CtElement)



process
void process(E element)(Code)
A callback method upcalled by the meta-model scanner to perform a dedicated job on the currently scanned element. The way Spoon upcalls this method depends on the processed element types ( Processor.getProcessedElementTypes() ), the traversal strategy ( Processor.getTraversalStrategy() ), and the used processing manager ( Environment.getManager . Also, this method is upcalled only if the method Processor.isToBeProcessed(CtElement) returns true for a given scanned element. In order to manually scan the meta-model, one can define the Processor.process() method instead.
Parameters:
  element - the element that is currenly being scanned



process
void process()(Code)
A callback method upcalled by the manager so that this processor can manually implement a processing job. On contrary to Processor.process(CtElement) , this method does not rely on a built-in meta-model scanner and has to implement its own traversal strategy on the meta-model, which is stored in the factory ( FactoryAccessor.getFactory ). Note that if a processor implements both process methods, this one is upcalled first. This method does nothing in default implementations ( spoon.processing.AbstractProcessor ).



processingDone
void processingDone()(Code)
This method is upcalled by the ProcessingManager when this processor has finished a full processing round on the program's model. It is convenient to override this method to tune the application's strategy of a set of processors, for instance by dynamically adding processors to the processing manager when a processing round ends (see ProcessingManager.addProcessor(Class) ). Does nothing by default.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.