public static boolean isCharType(Object o2, STFldCharType charType) { o2 = XmlUtils.unwrap(o2); if (o2 instanceof org.docx4j.wml.FldChar) { FldChar fldChar = (FldChar)o2; if (fldChar.getFldCharType().equals(charType) ) { return true; } else { log.debug(fldChar.getFldCharType().toString()); } } return false; }
@Override public List<Object> apply(Object o) { // System.out.println(o.getClass().getName()); // if (o instanceof P) { // currentP = (P)o; // } if (o instanceof org.docx4j.wml.FldChar) { FldChar fldChar = (FldChar)o; if (fldChar.getFldCharType().equals(STFldCharType.BEGIN) ) { //System.out.println("Found a BEGIN"); depth++; P currentP = pStack.peek(); if (depth==1 && !starts.contains(currentP)) { starts.add(currentP); // System.out.println("Adding " + XmlUtils.marshaltoString(currentP)); } } if (fldChar.getFldCharType().equals(STFldCharType.END) ) { depth--; } } return null; }
private STFldCharType getFldCharType(R r) { STFldCharType ret = null; List<Object> rContent = r.getContent(); Object item = null; if ((rContent != null) && (!rContent.isEmpty())) { for (int i=0; i<rContent.size(); i++) { item = XmlUtils.unwrap(rContent.get(i)); if (item instanceof FldChar) { ret = ((FldChar)item).getFldCharType(); break; } } } return ret; } }
public static void updateComplexFieldDefinition(AbstractWmlConversionContext context, NodeIterator fldCharNodeIt) { org.docx4j.wml.FldChar field = null; Node node = fldCharNodeIt.nextNode(); try { field = (org.docx4j.wml.FldChar)XmlUtils.unmarshal( node, Context.jc, org.docx4j.wml.FldChar.class); } catch (JAXBException e1) { e1.printStackTrace(); } STFldCharType fieldCharType = field.getFldCharType(); if (fieldCharType==null) { if (log.isDebugEnabled()) { log.debug("Ignoring unrecognised: " + XmlUtils.w3CDomNodeToString(node)); } } else { context.updateComplexFieldDefinition(fieldCharType); } }
artificialList.add(fldChar.getFldCharType()); if(fldChar.getFfData() != null) { artificialList.add(fldChar.getFfData());
FldChar fldChar = ((FldChar)o); List<Object> artificialList = new ArrayList<Object>(); artificialList.add(fldChar.getFldCharType()); if(fldChar.getFfData() != null) { artificialList.add(fldChar.getFfData());
conversionContext.updateComplexFieldDefinition(((org.docx4j.wml.FldChar)o).getFldCharType());
if (fldChar.getFldCharType().equals(STFldCharType.BEGIN) ) { field_begin_counter++; if (fldChar.getFfData()!=null) {
public static boolean isCharType(Object o2, STFldCharType charType) { o2 = XmlUtils.unwrap(o2); if (o2 instanceof org.docx4j.wml.FldChar) { FldChar fldChar = (FldChar)o2; if (fldChar.getFldCharType().equals(charType) ) { return true; } else { log.debug(fldChar.getFldCharType().toString()); } } return false; }
@Override public List<Object> apply(Object o) { // System.out.println(o.getClass().getName()); // if (o instanceof P) { // currentP = (P)o; // } if (o instanceof org.docx4j.wml.FldChar) { FldChar fldChar = (FldChar)o; if (fldChar.getFldCharType().equals(STFldCharType.BEGIN) ) { //System.out.println("Found a BEGIN"); depth++; P currentP = pStack.peek(); if (depth==1 && !starts.contains(currentP)) { starts.add(currentP); // System.out.println("Adding " + XmlUtils.marshaltoString(currentP)); } } if (fldChar.getFldCharType().equals(STFldCharType.END) ) { depth--; } } return null; }
private STFldCharType getFldCharType(R r) { STFldCharType ret = null; List<Object> rContent = r.getContent(); Object item = null; if ((rContent != null) && (!rContent.isEmpty())) { for (int i=0; i<rContent.size(); i++) { item = XmlUtils.unwrap(rContent.get(i)); if (item instanceof FldChar) { ret = ((FldChar)item).getFldCharType(); break; } } } return ret; } }
public static void updateComplexFieldDefinition(AbstractWmlConversionContext context, NodeIterator fldCharNodeIt) { org.docx4j.wml.FldChar field = null; Node node = fldCharNodeIt.nextNode(); try { field = (org.docx4j.wml.FldChar)XmlUtils.unmarshal( node, Context.jc, org.docx4j.wml.FldChar.class); } catch (JAXBException e1) { e1.printStackTrace(); } STFldCharType fieldCharType = field.getFldCharType(); if (fieldCharType==null) { if (log.isDebugEnabled()) { log.debug("Ignoring unrecognised: " + XmlUtils.w3CDomNodeToString(node)); } } else { context.updateComplexFieldDefinition(fieldCharType); } }
artificialList.add(fldChar.getFldCharType()); if(fldChar.getFfData() != null) { artificialList.add(fldChar.getFfData());
FldChar fldChar = ((FldChar)o); List<Object> artificialList = new ArrayList<Object>(); artificialList.add(fldChar.getFldCharType()); if(fldChar.getFfData() != null) { artificialList.add(fldChar.getFfData());
conversionContext.updateComplexFieldDefinition(((org.docx4j.wml.FldChar)o).getFldCharType());
if (fldChar.getFldCharType().equals(STFldCharType.BEGIN) ) { field_begin_counter++; if (fldChar.getFfData()!=null) {