Programmers often need to add methods to classes that are part of the language runtime itself.
开发人员经常有向某一语言内建类中添加方法的需求。
Here's the punchline: the moment we can add methods to classes this "simple check" is not enough.
于是就有了这样可笑的事:在我们能够添加方法到类中的时候,这种“简单的检查”是不够的。
You can also add methods and data to existing Ruby classes because classes are open.
还可以添加方法和数据到已有的类中,因为类是开放式的。
This API is generic and does not need to be modified if you need to add more classes or methods.
这个API是通用的,如果您想添加更多的类或方法,不需要对其进行修改。
You can use any (or all) of the techniques outlined in this article to add methods easily to one, some, or all of the classes you want.
您可以使用本文介绍的任何(或所有)技巧来向任意数量的类添加方法。
Fortunately, both Groovy and Ruby allow you to add new methods to single instances of classes.
幸运的是,Groovy和Ruby都允许您向单个类实例添加新的方法。
JiBX USES bytecode enhancement to add methods to compiled classes that convert instances of the classes to and from XML.
JiBX使用字节码增强向编译后的类添加方法,以便在类的实例与XML之间进行转换。
In this Practically Groovy installment, you'll learn about metaprogramming - Groovy's ability to add new methods to classes dynamically at run time.
在这期实战groovy文章中,您将了解元编程—Groovy在运行时向类动态添加新方法的能力。
Now that I have laid the groundwork, it's time to look at implementing the classworking transformation that will add toString() methods to annotated classes as they're being loaded.
既然已经打好了基础,就该研究实现 classworking转换了:当载入带注释的类时向它们添加toString()方法。
To make Prototype's classes and methods available, download the latest file from the Prototypejs.org Web site and add it to your HTML page, as in Listing 9.
为了使用prototype类和方法,从Prototypejs.orgWeb站点下载最新的文件并把它添加到HTML页面中,见清单9。
Next, let's add methods to each of the classes to simply wrap the methods defined for the TableAdapters from the first tutorial.
接下来,让我们来给这些新建的类加上一些方法,简单的将第一节中的TableAdapter中的那些方法包装起来就行了。
If we add methods that should not be there the classes implementing the interface will have to implement those methods as well.
如果我们增加了不应有的方法,继承这个接口的类将不得不同时实现这些方法。
However, you can add custom code that is specific to your business problem without having to worry about setting up classes and methods.
但是,您可以添加特定于您的业务问题的自定义代码,并且不必为设置类和方法而烦恼。
The trace code is everywhere you want it, even if you add new methods to the target classes.
在任何你需要的地方跟踪代码,即使你增加了新的方法到目标类。
Using open classes to add new methods to a built-in class is a common technique for adding expressiveness to DSLs.
使用打开类将新方法添加到内置类是一种将表现力添加到 DSL的常用技术。
If package access prevents objects from communicating, add more public methods to the classes.
如果包访问不利于对象间的通信,就需要向类中添加更多的公共方法。
He also showed how to add behavior to classes, fields and methods and talked about annotating Types and methods with Aspects.
他还展示了如何向类、属性和方法中添加行为,也谈到了如何使用Aspects来注解类型和方法。
To alter the sample classes, add your own getter or read methods which get data you want to use in rules.
要更改这些示例类,可以添加您自己的getter或者read方法,它们用于获取您希望在规则中使用的数据。
How to Add Summary Details for Classes, Methods and parameters?
如何给类,方法,参数添加摘要细节?
How to Add Summary Details for Classes, Methods and parameters?
如何给类,方法,参数添加摘要细节?
应用推荐