哪些公共方法能够被声明为private ?
只有不带参数的公共方法能注释为生命周期方法。
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.
用于定义组件和接口的公共方法或公共语言。
A common approach, or common language for defining components and interfaces.
例如,假设您希望利用反射显示给定类的所有公共方法。
For example, say that you want to display all of the public methods of a given class using reflection. Listing 7 shows an example.
我怎么能从一个私人访问一个模块的公共方法?
How can I access the public methods on a module from a private?
只有包含在应用程序架构的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.
学习如何构建Web服务,禁止对私有和公共方法进行Web访问?
Learn how to construct Web services that protect both private and public methods from Web access.
如果包访问不利于对象间的通信,就需要向类中添加更多的公共方法。
If package access prevents objects from communicating, add more public methods to the classes.
为此,只需删除清单3中的所有ui并且只在顶部保留那些公共方法。
To do that, we simply remove all of the UI from Listing 3 and just keep those public methods at the top.
与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.
最后,该惯例要求方法为公共,因此我使用查找格式,查找类上可调用的公共方法。
Finally, the convention requires the methods to be public, so I use the form of lookup that finds public methods callable on the class.
注意,清单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.
与字段调用一样,前两个变量返回可以通过类接入的公共方法的信息——即使它们来自于祖先类。
As with the field calls, the first two variants return information for public methods that can be accessed through the class — even those inherited from an ancestor class.
整个应用程序架构中用于启动、提交和回滚事务的惟一方法就是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.
假如我能找到所有调用该方法的代码,那我就可以也应当改变这个方法的名称,即使它是一个公共方法。
If I can find all the code that calls the method, even though it's a public method, I can change its name.
EJB上的每个公共方法都定义了ejb容器和EJB客户端之间的事务边界,并在部署描述符指定该边界。
Every public method on an EJB defines a transactional boundary between the EJB container and the EJB client, as specified in the deployment descriptor.
管理程序中的设备模拟是在VMware工作站产品(一个基于操作系统的管理程序)中实现的一个公共方法。
Device emulation within the hypervisor is a common method implemented within the VMware workstation product (an operating system-based hypervisor).
但若您的项目规模越来越大,或者您在使用公共文件的企业环境中工作,一种公共方法就变得十分必要。
But as your project gets larger or if you work in an enterprise environment that USES common files, a common approach becomes necessary.
但若您的项目规模越来越大,或者您在使用公共文件的企业环境中工作,一种公共方法就变得十分必要。
But as your project gets larger or if you work in an enterprise environment that USES common files, a common approach becomes necessary.
应用推荐