d.GetType().GetProperty("value2").GetValue(d, null);
Run Code Online (Sandbox Code Playgroud)
这将返回d中value2属性的值.
我想要value2中的属性值,即d.value2.value3.
我该怎么做到这一点?
我正在尝试向Firebase团队报告错误,他们建议在网站上发布问题.
我正在使用最新的Java SDK来监听节点更改事件.在迭代DataSnapshot对象时,下面的异常会发生
请注意,错误在库内,而不在我的代码中.
码:
void printData(DataSnapshot data) {
System.out.println(data.getName() + ":" + data.getValue());
Iterator<DataSnapshot> it = data.getChildren().iterator();
while (it.hasNext()) {
DataSnapshot dataSnapshot = (DataSnapshot) it.next();
printData(dataSnapshot);
}
}
Run Code Online (Sandbox Code Playgroud)
数据:
onChildAdded
-e42170ec-a44f-4dcf-9d18-76a39165cea7:{ts=1405260544422, rating=2}
--rating:2
Run Code Online (Sandbox Code Playgroud)
异常堆栈跟踪:
Exception in thread "FirebaseEventTarget" java.lang.ClassCastException: com.firebase.client.snapshot.LongNode cannot be cast to com.firebase.client.snapshot.ChildrenNode
at com.firebase.client.DataSnapshot.getChildren(DataSnapshot.java:273)
at Read$1.printData(Read.java:54)
at Read$1.onChildAdded(Read.java:39)
at com.firebase.client.core.ChildListenerContainer$1.run(ChildListenerContainer.java:49)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
Run Code Online (Sandbox Code Playgroud) 我和我的伙伴正在为大学的面向对象编程课程开发一个程序.我们正在尝试将文本作为信息数据库写入文件.问题是当我们尝试用BufferedReader读取相应的行时,我们似乎无法弄清楚如何读取正确的行.唯一可用的函数似乎是read(),它只读取一个字符.readLine()只读取一行(不是我们想要它读取的行.skip()只跳过指定的一些字符.任何人都知道如何告诉程序我们想要读取哪一行?我们的方法getAnswer()使用参数int rowNumber是我们要做的:超类:http://pastebin.com/d2d9ac07f 子类是无关紧要的(主要是因为我们还没有编写它).当然它是我们正在使用的Java.先谢谢.
我不是程序员,但我已经整合了一个使用精美盒子的网站,并且在chrome和firefox方面都很好,但ie8&ie9是一场灾难.该网站是http://www.pinnaclebillboards.com.
我已经搜索过纠正问题,但我甚至不确定如何描述它.有人能指出我正确的方向吗?
jquery internet-explorer fancybox internet-explorer-8 internet-explorer-9
我试图在Magento的购物车中显示原始单价时遇到问题.默认情况下,Magento只显示特价,但我也想显示原价以突出节省.
我知道哪个模板需要更改,这是/template/checkout/cart/item/default.phtml.
在第145行显示
<?php
echo $this->helper('checkout')->
formatPrice($_incl-$_item->getWeeeTaxDisposition())
?>
Run Code Online (Sandbox Code Playgroud)
显示特价.我只是不知道显示原价的语法.