该异常的抛出,表明代码企图把对象的类型转换成一个子类,而该对象并不是这个子类的实例。
Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance.
您可以看到,强类型资源类自动将.png文件转换为能够直接加载到PictureBox中的Image对象。
You can observe that the strongly typed resource class automatically converts a.png file into an Image object that can be directly loaded into a PictureBox.
SimpleJPA会对依赖于数字类型的对象进行字符串转换和后续的填充(如果需要)。
SimpleJPA does the string conversion and any subsequent padding (if required) for objects that rely on numeric types.
强类型资源类还将嵌入的XML文件转换为能够轻松加载到 XmlDocument对象中的字符串。
The strongly typed resource class also converts the embedded XML file into a string that can be easily loaded into an XmlDocument object.
业务对象映射:可以使用业务对象映射将某种类型的业务对象转换成另一种类型的业务对象。
Business Object maps: You use a Business Object map to translate one type of Business Object into another type of Business Object.
为了理解这一点,记住标记中的任何内容都必须转换为某种类型的对象。
To understand this, remember that everything in your markup has to be turned into an object of some type.
转换器必须在这里将请求字符串转换为所需的对象类型,然后返回这个对象,将它存储在相应的JSF组件中。
This is where the converter must convert the request string value into the desired object type, and then return the object for storage in the corresponding JSF component.
提供为任意对象类型注册额外的转换器的功能。
Provides the ability to register additional converters for arbitrary object types.
我们偏向后一种方法,因为它让我们可以将自定义转换器(自带验证逻辑)与特定的对象类型相关联,并让JSF处理这种对象类型。
We prefer the latter option because it allows us to simply associate a custom converter (with built-in validation logic) with a specific object type and have JSF handle that object type.
组件值已经经过了类型转换和有效性验证,并被应用到模型对象中了,因此您现在可以使用它们来执行应用程序的业务逻辑了。
The component values will have been converted, validated, and applied to the model objects, so you can now use them to execute the application's business logic.
使用型态转换将返回的对象转换成期望的服务接口类型的对象。
Use typecast to convert the returned object to the desired service interface type.
修复这类异常的最简单方式就是仔细检查对象要转换到的类型是否符合以上提到的规则。
The easiest way to fix such exceptions is to carefully check that the type to which an object is being cast conforms to the rules mentioned above.
另一个例子,在调用宿主对象的函数时,如何进行类型强制转换,这也是没有规定的。
Another example is that it's not explained how types are coerced when calling functions on host objects. For example, when you do.
接下来的表格,列出了这些IDs,以及您想要在转换配置中看到的对象类型。
The following table lists these IDs and the object types that you would expect to see in the transformation configuration.
如果转换器产生了一个交易类型的对象,随后处理类必须包含一个名为handle (trade trade)的方法。
If the converter produced an object of type trade, then the handler class must contain a method named handle (trade trade).
所以,例如通过将返回对象指定为“json ”类型,jQuery将能自动将来自服务器的响应字符串转换成json对象,使您能够立即引用它。
So, for example, by specifying the return object as a type "json", jQuery will automatically convert the response String from a server into a json object, allowing you to reference it immediately.
模拟对象到Collaborator类型的类强制转换十分有必要,因为intercept方法将返回类型Object。
The class cast of the mock object into type Collaborator is necessary because the intercept method returns type object.
JBoss没有显式地绑定Account参数,而是提供了对当前正在执行的对象的反射访问,因此需要把类型转换到对应的类型。
Rather than binding the Account parameter explicitly, JBoss provides reflective access to currently executing objects, requiring a cast to the corresponding type.
注意:您需要强制转换返回类型 ―getValue返回一个Object 类型的对象。
Note that you need to cast the return type -- getValue returns an object of type Object.
要从集合中提取元素,您必须知道集合中对象的类型,以将其强制转换为合适的局部变量。
To fetch elements from the collection, you had to know the type of object in the collection so you could cast it back to the appropriate local variable.
简单地说,转换是确保数据拥有正确的对象或者类型的过程。
Simply put, it's the process of ensuring data is of the right object or type. Here are two typical conversions.
不过,如果您的确想要得到值的列表,可以对所返回的dict对象进行强制类型转换。
But, if you really want a list of values, you can always cast the returned dict object. For example.
当检查对象(例如清单5中的item)并把类型转换成目标类(Integer)时,类装入器会检查以下规则。
Given an object being tested (such as item in Listing 5) and a target class (Integer) being cast to, the class loader checks the following rules.
如果5.0MXBean的远程调用要求传递复杂类型的实例,那么对象就被转换成等价的CompositeData。
If you make a remote call to a 5.0 MXBean that requires passing an instance of a complex type, the object is converted to its CompositeData equivalent.
这意味着你可以直接在返回的对象上访问成员,或者可以使用强类型的局部变量为其赋值,而无需进行转换。
This means that you can easily access members directly off a returned object, or you can assign it to a strongly typed local variable without having to cast.
串的转换先计算所包括的表达式表的值,然后按照其结果类型所特定的规则转换其结果对象为字符串。
A string conversion evaluates the contained expression list and converts the resulting object into a string according to rules specific to its type.
此服务使标记扩展和类型转换器将XAML名称解析为来自同一xaml源中的其他对象,同时仍位于XAML节点表示中。
This service enables markup extensions and type converters to resolve XAML names to other objects from the same XAML source while they are still in a XAML node representation.
此服务使标记扩展和类型转换器将XAML名称解析为来自同一xaml源中的其他对象,同时仍位于XAML节点表示中。
This service enables markup extensions and type converters to resolve XAML names to other objects from the same XAML source while they are still in a XAML node representation.
应用推荐