Changeset 1106 for trunk/docx4j/src/main/java/org/docx4j/TextUtils.java
- Timestamp:
- 03/26/10 23:35:01 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docx4j/src/main/java/org/docx4j/TextUtils.java
r1096 r1106 27 27 28 28 import javax.xml.bind.JAXBContext; 29 import javax.xml.bind.JAXBElement; 29 30 import javax.xml.bind.Marshaller; 31 import javax.xml.namespace.QName; 30 32 31 33 import org.apache.log4j.Logger; … … 42 44 43 45 /** 44 * Extract contents of <w:t> elements.46 * Extract contents of descendant <w:t> elements. 45 47 * 46 48 * @param o … … 54 56 55 57 /** 56 * Extract contents of <w:t> elements.58 * Extract contents of descendant <w:t> elements. 57 59 * 58 60 * @param o … … 68 70 69 71 } 72 73 /** 74 * Extract contents of descendant <w:t> elements. 75 * Use this for objects which don't have @XmlRootElement 76 * 77 * @param o 78 * @param w 79 * @param jc 80 * @param uri 81 * @param local 82 * @param declaredType 83 * @throws Exception 84 */ 85 public static void extractText(Object o, Writer w, JAXBContext jc, 86 String uri, String local, Class declaredType) throws Exception { 87 88 Marshaller marshaller=jc.createMarshaller(); 89 NamespacePrefixMapperUtils.setProperty(marshaller, 90 NamespacePrefixMapperUtils.getPrefixMapper()); 91 marshaller.marshal( 92 new JAXBElement(new QName(uri,local), declaredType, o ), 93 new TextExtractor(w)); 94 } 95 70 96 71 97 /**
Note: See TracChangeset
for help on using the changeset viewer.
