private Object createObject(String name, Object id ) throws Exception { ObjectFactory factory = Context.getWmlObjectFactory(); log.debug("Looking for method create" + name); Method method = factory.getClass().getDeclaredMethod("create" + name); Object newObject = method.invoke(factory); Method setIdMethod = findSetIdMethod(newObject); if (setIdMethod==null) { log.error( "Couldn't findSetIdMethod for " + newObject.getClass().getName()); } else { log.debug( "FOund findSetIdMethod for " + newObject.getClass().getName()); } Class param = setIdMethod.getParameterTypes()[0]; setIdMethod.invoke(newObject, convertObject(id, param)); return newObject; }
/** * Provide a way to for user to fetch the starting bookmark ID number * for use in the next stage (ie Binding Traverse). * * If it isn't fetched/set, the value will have to be recalculated (less efficient). * * @since 3.2.1 */ public AtomicInteger getNextBookmarkId() { return bookmarkRenumber.getBookmarkId(); }
protected AtomicInteger getBookmarkId() { if (bookmarkId==null) { // Work out starting ID bookmarkId = new AtomicInteger(initBookmarkIdStart()); } return bookmarkId; }
endIdMethod = findGetIdMethod(o); Object id = null; try { id = getId(endIdMethod, o); id = getIdString(endIdMethod, o); long newId = getBookmarkId().getAndIncrement(); startIdMethod = findGetIdMethod(o); id = getId(startIdMethod, o); Method setIdMethod = findSetIdMethod(o); if (id instanceof BigInteger) { setIdMethod.invoke(o, BigInteger.valueOf(newId)); for (Object end : rt.ends) { if (endIdMethod == null) endIdMethod = findGetIdMethod(end); tmpId = getId(endIdMethod, end); if (tmpId!=null && tmpId.equals(id)) { Method setIdMethod = findSetIdMethod(end); if (id instanceof BigInteger) { setIdMethod.invoke(end, BigInteger.valueOf(newId));
shallowTraversor.wordMLPackage = wordMLPackage; bookmarkRenumber = new BookmarkRenumber(wordMLPackage);
bookmarkRenumber.fixRange( ((SdtElement)repeated.get(i)).getSdtContent().getContent(), "CTBookmark", "CTMarkupRange", null, global, i);
endIdMethod = findGetIdMethod(o); Object id = null; try { id = getId(endIdMethod, o); id = getIdString(endIdMethod, o); long newId = getBookmarkId().getAndIncrement(); startIdMethod = findGetIdMethod(o); id = getId(startIdMethod, o); Method setIdMethod = findSetIdMethod(o); if (id instanceof BigInteger) { setIdMethod.invoke(o, BigInteger.valueOf(newId)); for (Object end : rt.ends) { if (endIdMethod == null) endIdMethod = findGetIdMethod(end); tmpId = getId(endIdMethod, end); if (tmpId!=null && tmpId.equals(id)) { Method setIdMethod = findSetIdMethod(end); if (id instanceof BigInteger) { setIdMethod.invoke(end, BigInteger.valueOf(newId));
shallowTraversor.wordMLPackage = wordMLPackage; bookmarkRenumber = new BookmarkRenumber(wordMLPackage);
bookmarkRenumber.fixRange( ((SdtElement)repeated.get(i)).getSdtContent().getContent(), "CTBookmark", "CTMarkupRange", null, global, i);
private Object createObject(String name, Object id ) throws Exception { ObjectFactory factory = Context.getWmlObjectFactory(); log.debug("Looking for method create" + name); Method method = factory.getClass().getDeclaredMethod("create" + name); Object newObject = method.invoke(factory); Method setIdMethod = findSetIdMethod(newObject); if (setIdMethod==null) { log.error( "Couldn't findSetIdMethod for " + newObject.getClass().getName()); } else { log.debug( "FOund findSetIdMethod for " + newObject.getClass().getName()); } Class param = setIdMethod.getParameterTypes()[0]; setIdMethod.invoke(newObject, convertObject(id, param)); return newObject; }
/** * Provide a way to for user to fetch the starting bookmark ID number * for use in the next stage (ie Binding Traverse). * * If it isn't fetched/set, the value will have to be recalculated (less efficient). * * @since 3.2.1 */ public AtomicInteger getNextBookmarkId() { return bookmarkRenumber.getBookmarkId(); }
protected AtomicInteger getBookmarkId() { if (bookmarkId==null) { // Work out starting ID bookmarkId = new AtomicInteger(initBookmarkIdStart()); } return bookmarkId; }