When shouldn't you use accessors?
何时不应该使用读写方法?
Accessors do not have memory references to other accessors.
内存中accessors没有对其他accessors的引用。
It contains accessors for properties and a validation method.
它包含属性访问程序和一个验证方法。
In the "Choose new accessors" dialog of the wizard, select Next.
在向导的“Choosenew accessors”对话框中,选择Next。
The control data accessors used in the methods are defined in next step.
这些方法中使用的控制数据访问器在下一步中定义。
As we have seen, accessors are endpoints that return resource representations.
正如我们所知,访问器是返回资源表示的端点。
Another (much misunderstood) setting also affects the reflection accessors.
另一种(极易造成误解的)设置也会影响反射存取器。
Fields should never be accessed directly; instead, accessors should be used.
决不应该直接访问字段;而应该使用访问器。
This way these generic accessors can be used on any number of wrapped point objects.
这样的话,这些通用的访问器可以用在任意数量的包装的point对象上。
There are several X509 certificate property accessors on the X509Certificate class.
在 X509Certificate 类中有一些X509证书属性访问器。
Properties with these illegal accessors tend to be ignored when mapping a bean to WSDL.
在将一个Bean映射到WSDL时,带有这些非法访问器的属性往往被忽略。
In the create new accessors dialog, we create all the variables that we want to use.
在Createnew accessors对话框中,我们创建所有想要使用的变量。
As with accessors, the specified callbacks are invoked whenever a property is accessed.
像访问器一样,当一个属性被访问时指定的回调函数就会被激活。
Figure 4 shows some important accessors; it omits the corresponding accessor factories.
图4显示了一些重要的访问器;其中省略了对应的访问器工厂。
You then use standard accessors to "inject" references to the objects your classes depend on.
然后用标准访问器将引用“注入”到类所依赖的对象中。
After the fields and their accessors are declared, the methods of the Employee class come next.
字段及其访问器声明之后,下面出现的是employee类的方法。
The accessors read directly from, or write to, the respective positions in the state document model.
访问器直接对状态文档模型中的各个位置进行读写。
ActiveRecord dynamically creates accessors based on the column names of the database table that it is mapped to.
ActiveRecord根据映射的数据库表的列名动态创建访问器。
It has fields corresponding to the database columns and the usual accessors (getters and setters) for each field.
它有与数据库列对应的字段及用于每个字段的常用存取器(getter和setter)。
Set the accessors stereotype property to true, thereby indicating that add and remove accessors will be specified.
将accessors原型属性设置为true,从而说明将指定add和remove accessors。
Let's say that as a user of the Widget class, you don't know whether the accessors have value or reference semantics.
假设您是Widget类的一个使用者,您并不知道存取器具有值语义还是引用语义。
Accessor methods come in two flavors: setters and getters (sometimes referred to as mutators and accessors, respectively).
访问器方法涉及两种方法:setters和getters(有时分别称为mutators和accessors)。
My experience is that you should always strive to make accessors protected, so only subclasses can access the attributes.
我的经验是应该总是使读写方法受保护,所以只有子类可以访问其属性。
Finally, we see the @accessors annotation, which is a macro that creates getter/setter methods for the field that precedes it.
最后是 @accessors注释,这是一个宏,用于为它前面的字段创建getter/setter方法。
At its bare minimum you can write pure Ruby classes with attribute accessors and create the usual Hibernate mapping files by hand.
在最简单的情况下,你可以编写只带属性访问器的纯粹Ruby类,然后手动创建出常见的Hibernate映射文件。
In this bean class most of the methods, other than the EJB call back methods, are accessors and setters for the above properties.
在这个bean类中,大多数方法(EJB回调方法除外)都是上述属性的accessor和setter。
In the bad code example in Listing 1, the fields of the Person object are exposed directly as public fields instead of with accessors.
在清单1的坏代码示例中,Person对象的字段被直接公开为公共字段而非使用访问方法。
For instance, when I create a new class, I no longer spend any time writing setters and getters (accessors). I don't write most of the constructors.
例如,创建新类时,我不再花时间编写setter和getter(访问器),也不用编写大部分的构造器。
At the same time, accessors increase the robustness of classes and components because they help to hide the implementation details of your classes.
同时,由于读写方法帮助隐藏了类的实现细节,因而增强了类和组件的健壮性。
One simple way to begin hiding your information is to keep fields private and to expose them with public accessors, which are like Windows in your house.
开始隐藏信息的一种简单方法是保持字段私有并且用公共访问方法公开这些字段,就像家中的窗户一样。
应用推荐