哪些公共方法能够被声明为private ?
用于定义组件和接口的公共方法或公共语言。
A common approach, or common language for defining components and interfaces.
只有不带参数的公共方法能注释为生命周期方法。
Only public methods that have no arguments can be annotated as lifecycle methods.
一般而言,类的每个公共方法都应有一个单元测试。
In general, there should be a unit test for every public method of your class.
创建一个稍后将会被客户端程序所访问的公共方法。
Create a public method to be called later by a client program.
如果愿意的话,还可以将行为委派给方面的公共方法。
You can also delegate the behavior to a public method on the aspect if you choose.
例如,假设您希望利用反射显示给定类的所有公共方法。
For example, say that you want to display all of the public methods of a given class using reflection. Listing 7 shows an example.
只有包含在应用程序架构的api层中的公共方法包含事务逻辑。
Only the public methods included in the application architecture's API layer contain transaction logic.
我们实现这个类来提供一些公共方法并隐藏SNMP接口的细节。
We implemented this class to provide some common methods and to hide the details of the SNMP interface.
如果包访问不利于对象间的通信,就需要向类中添加更多的公共方法。
If package access prevents objects from communicating, add more public methods to the classes.
与booksearch类中的公共方法类似,这些方法的代码如下。
As for the public methods in our BookSearch class, the code for these methods is as follows.
在缺省的情况下,向导预先选择了所有的公共方法,这正是我们所需要的。
By default, the wizard pre-selects all public methods, which is what we want.
注意,清单11中的两个方法都是公共方法,这意味着它们可以单独调用。
Notice in Listing 11 that both of these methods are public, implying that they can be invoked independently from each other.
模型代码需要能够从一个已知的位置装载数据,并提供一个公共方法用于提供那些数据。
The model code needs to be able to load data from a known location and offer a public method to provide that data.
不用在相同的方法中使用编程事务,而是将更新操作移动到调用栈的另一个公共方法中。
Rather than using programmatic transactions within the same method, you can move the update operations to another public method within the call stack.
ACLPerspective的四种公共方法为调用方提供了实际视图和底层数据结构。
The four public methods of the ACLPerspective supply callers with actual views and underlying data structures.
通过安排不同类型的对象来执行公共方法,我们将分派决定移到对象中并从显式条件块中消除。
By arranging for objects of different types to implement common methods, we move the dispatch decision into the objects and out of an explicit conditional block.
对于这个范例,facade接口为每个command公开了一个公共方法,如清单6所示。
For this example, the facade interface exposes one public method for each command, as illustrated in Listing 6.
remote接口是通过home接口检索得到的,为您提供了对远程对象的公共方法的访问。
The remote interface, retrieved through the home interface, gives you access to the public methods of the remote object.
整个应用程序架构中用于启动、提交和回滚事务的惟一方法就是api层的域类中包含的公共方法。
The only methods in the entire application architecture that start, commit, and roll back a transaction are public methods contained in API layer's domain classes.
由于这两个更新方法都是公共方法,并且从客户机层的角度看被公开为api层入口点,因此它们包含了回滚逻辑。
Because both update methods are public and are therefore exposed as API-layer entry points from the client-layer perspective, they contain rollback logic.
示例中的切入点使用了修饰符(modifier)和通配符(wildcard)模式来表达“所有公共方法”。
The pointcut in the example uses a modifier and wildcard pattern to express "all public methods."
正式的、可外部配置的“工具箱”,可以增加在模板中使用的自定义工具(这里讲的工具只是具有公共方法的已编译的类)。
A formalized, externally configurable "toolbox" for adding custom tools that can be used by the template (tools in this sense are just compiled Java classes that have public methods).
在那一刻,您可能会想:“如果想不出一种命名和查找这些数据的公共方法的话,我只好不作生物学家,而改行当程序员了。”
At this point, you may be thinking that coming up with a common way of naming and finding this data is the only way you will be able to remain a biologist and not a programmer.
可以根据需要将这些注解添加到适当的方法上,从而实现对生命周期事件的响应;只要求这些方法是公共方法,没有参数并返回void。
You add these annotations as needed to any public, parameterless method that returns void to implement reactions to life-cycle events.
ServiceDataObject (SDO):SDO提供了访问许多不同种类数据的公共方法,从而对SCA进行了补充。
Service Data Object (SDO): SDO complements SCA by providing a common way to access many different kinds of data
相反,它们都是一些传统的JSF动作处理程序,或者是受管bean上的公共方法,这些方法或者无实参或者接受ActionEvent。
Instead, they are traditional JSF action handlers, which are public methods on managed beans that either have no-arguments or accept an ActionEvent.
测试所有执行“令人感兴趣的”功能(即,不是getter和setter,除非它们以某种独特的方式执行获取和设置操作)的公共方法。
Test all the public methods that perform an "interesting" function (that is, not getters and setters, unless they do their getting and setting in some unique way).
利用UML,软件专业人员可以以一种统一一致的方式对他们的分析和设计部件进行可视化建模,这样团队就有了一种处理沟通和项目文档的公共方法。
With UML, software professionals can visually model their analysis and design artifacts in a uniform and consistent manner, so teams have a common approach for communication and project documentation.
利用UML,软件专业人员可以以一种统一一致的方式对他们的分析和设计部件进行可视化建模,这样团队就有了一种处理沟通和项目文档的公共方法。
With UML, software professionals can visually model their analysis and design artifacts in a uniform and consistent manner, so teams have a common approach for communication and project documentation.
应用推荐