访问器和调整器也添加了进来。
使用访问器api读写导航状态。
Reading and writing navigational state using the Accessor API.
访问器模式如图2 所示。
第3步:生成一个空访问器。
这样就能保证访问器访问了整个层次树。
This ensures that the visitor will visit the entire hierarchy.
访问器从其上下文中寻找它要做的事情。
An accessor discovers from its context what it is being asked to do.
下面我们回到物理层来仔细看看访问器。
Next we switch back to the physical level and take a closer look at accessors.
访问器和拦截器将在本文档的后面讨论。
Accessors and interceptors are discussed later in this document.
请参阅使用访问器api读写导航状态。
See Reading and writing navigational state using the Accessor API.
访问器本身是非常简单的。
Accessors themselves are very simple. They can only do four things.
如果遇到多次属性访问,输出访问器方法。
Once more iterate over the attributes and output accessor methods.
决不应该直接访问字段;而应该使用访问器。
Fields should never be accessed directly; instead, accessors should be used.
为了处理资源,构造器使用了访问器模式。
To process the resources, the builder uses the visitor pattern.
以后的提示中会涉及访问器方法的有效使用。
The effective use of accessor methods will be covered in future tips.
正如我们所知,访问器是返回资源表示的端点。
As we have seen, accessors are endpoints that return resource representations.
清单中的各访问器方法将签名字符串作为参数。
Each of the visitor methods shown takes a signature string as a parameter.
有时候你可能不希望自动生成这些访问器方法。
There are times when you don't want the accessor methods to be generated automatically.
访问器api提供对状态文档模型类型化的访问。
The Accessor API provides typed access to the state document model.
这些方法中使用的控制数据访问器在下一步中定义。
The control data accessors used in the methods are defined in next step.
访问器直接对状态文档模型中的各个位置进行读写。
The accessors read directly from, or write to, the respective positions in the state document model.
然后用标准访问器将引用“注入”到类所依赖的对象中。
You then use standard accessors to "inject" references to the objects your classes depend on.
如果对象参数为空,您需要为这个类型生成一个空访问器。
If the object argument is null, you need to generate a null accessor for the type.
第一步是为每个UI组件创建访问器方法,如清单2所示。
My first step is to create accessor methods for each UI component, shown in Listing 2.
在调用visit的过程中,访问器对节点执行适当的操作。
During the call to visit , the visitor performs the appropriate operation on the node.
图4显示了一些重要的访问器;其中省略了对应的访问器工厂。
Figure 4 shows some important accessors; it omits the corresponding accessor factories.
同时,我已记不清曾有多少开发人员抱怨访问器方法的性能了。
At the same time, I've lost track of the number of developers I've met who complain about accessor method performance.
像访问器一样,当一个属性被访问时指定的回调函数就会被激活。
As with accessors, the specified callbacks are invoked whenever a property is accessed.
但是访问器更接近于Python的xmllib模块的编程风格。
However, a visitor is even closer to the programming style of Python's xmllib module.
签名的基本处理是通过直接传递给恰当的访问器方法的值自动实现的。
The basic handling of signatures is automatic, using values passed directly to the appropriate visitor methods.
节点实现了accept()方法,该方法接受访问器作为参数。
The node implements the accept() method, which takes a visitor as a parameter.
应用推荐