java.lang.ClassCastException: org.docx4j.wml.R cannot be ca
Posted: Thu Sep 22, 2016 1:38 am
I have an Object o, which I'm trying to cast to org.docx4j.wml.Text. get it's parent and then cast to javax.xml.bind.JAXBElement. The parent returns a org.docx4j.wml.R and then the casting gives a java.lang.ClassCastException, is this an expected behaviour? how can I do the casting correctly
The condition I'm trying to check is
The condition I'm trying to check is
- Code: Select all
if (!((javax.xml.bind.JAXBElement)((org.docx4j.wml.Text) o).getParent()).getName().getLocalPart().equalsIgnoreCase("instrText"))