/** * Returns a DurationType instance representing the specified String value * * @param stringValue a String value * * @return return a DurationType instance representing stringValue * @throws IllegalArgumentException if the given argument is not a valid Duration */ public static Duration valueOf(String stringValue) throws IllegalArgumentException { if (stringValue == null) { throw new IllegalArgumentException( "parameter can not be null for Duration"); } try { DatatypeFactory aFactory = DatatypeFactory.newInstance(); return new Duration(aFactory.newDuration(stringValue)); } catch (DatatypeConfigurationException ex1) { Logger.getLogger(Duration.class.getName()).log(Level.SEVERE, "DatatypeFactory can not be instanced", ex1); return null; } catch (IllegalArgumentException ex2) { Logger.getLogger(Duration.class.getName()).log(Level.SEVERE, "parameter is invalid for datatype Duration", ex2); throw new IllegalArgumentException( "parameter is invalid for datatype Duration"); } }
/** * Sets the value of the odf dom element representation * <code>MetaEditingDurationElement</code>. * * @param editingDuration the time need to set * @see org.odftoolkit.odfdom.dom.element.meta.MetaEditingDurationElement */ public void setEditingDuration(Duration editingDuration) { MetaEditingDurationElement editiingDurationEle = OdfElement.findFirstChildNode(MetaEditingDurationElement.class, mOfficeMetaElement); if (editiingDurationEle == null) { editiingDurationEle = mOfficeMetaElement.newMetaEditingDurationElement(); } editiingDurationEle.setTextContent(editingDuration.toString()); }
/** * Receives the value of the ODFDOM element representation * <code>MetaEditingDurationElement</code> , See {@odf.element * meta:editing-duration}. * * @return the total time spent editing the document; * <p> * <code>null</code>, if the element is not set. */ public Duration getEditingDuration() { MetaEditingDurationElement editiingDurationEle = OdfElement.findFirstChildNode(MetaEditingDurationElement.class, mOfficeMetaElement); if (editiingDurationEle != null) { return Duration.valueOf(editiingDurationEle.getTextContent()); } return null; }
modificationDate = metadata.getDcdate(); if (metadata.getEditingDuration() != null) { Duration duration = metadata.getEditingDuration().getValue(); editingTime = duration.getTimeInMillis(Calendar.getInstance()) / 1000;
/** * Returns a DurationType instance representing the specified String value * * @param stringValue a String value * * @return return a DurationType instance representing stringValue * @throws IllegalArgumentException if the given argument is not a valid Duration */ public static Duration valueOf(String stringValue) throws IllegalArgumentException { if (stringValue == null) { throw new IllegalArgumentException( "parameter can not be null for Duration"); } try { DatatypeFactory aFactory = DatatypeFactory.newInstance(); return new Duration(aFactory.newDuration(stringValue)); } catch (DatatypeConfigurationException ex1) { Logger.getLogger(Duration.class.getName()).log(Level.SEVERE, "DatatypeFactory can not be instanced", ex1); return null; } catch (IllegalArgumentException ex2) { Logger.getLogger(Duration.class.getName()).log(Level.SEVERE, "parameter is invalid for datatype Duration", ex2); throw new IllegalArgumentException( "parameter is invalid for datatype Duration"); } }
/** * Sets the value of the odf dom element representation * <code>MetaEditingDurationElement</code>. * * @param editingDuration the time need to set * @see org.odftoolkit.odfdom.dom.element.meta.MetaEditingDurationElement */ public void setEditingDuration(Duration editingDuration) { MetaEditingDurationElement editiingDurationEle = OdfElement.findFirstChildNode(MetaEditingDurationElement.class, mOfficeMetaElement); if (editiingDurationEle == null) { editiingDurationEle = mOfficeMetaElement.newMetaEditingDurationElement(); } editiingDurationEle.setTextContent(editingDuration.toString()); }
/** * Receives the value of the odf dom element representation * <code>MetaEditingDurationElement</code>. * * @return the total time spent editing the document; * <p> * <code>null</code>, if the element is not set. * @see org.odftoolkit.odfdom.dom.element.meta.MetaEditingDurationElement */ public Duration getEditingDuration() { MetaEditingDurationElement editiingDurationEle = OdfElement.findFirstChildNode(MetaEditingDurationElement.class, mOfficeMetaElement); if (editiingDurationEle != null) { return Duration.valueOf(editiingDurationEle.getTextContent()); } return null; }
/** * Returns a DurationType instance representing the specified String value * * @param stringValue a String value * * @return return a DurationType instance representing stringValue * @throws IllegalArgumentException if the given argument is not a valid Duration */ public static Duration valueOf(String stringValue) throws IllegalArgumentException { if (stringValue == null) { throw new IllegalArgumentException( "parameter can not be null for Duration"); } try { DatatypeFactory aFactory = DatatypeFactory.newInstance(); return new Duration(aFactory.newDuration(stringValue)); } catch (DatatypeConfigurationException ex1) { Logger.getLogger(Duration.class.getName()).log(Level.SEVERE, "DatatypeFactory can not be instanced", ex1); return null; } catch (IllegalArgumentException ex2) { Logger.getLogger(Duration.class.getName()).log(Level.SEVERE, "parameter is invalid for datatype Duration", ex2); throw new IllegalArgumentException( "parameter is invalid for datatype Duration"); } }
/** * Sets the value of the odf dom element representation * <code>MetaEditingDurationElement</code>. * * @param editingDuration the time need to set * @see org.odftoolkit.odfdom.dom.element.meta.MetaEditingDurationElement */ public void setEditingDuration(Duration editingDuration) { MetaEditingDurationElement editiingDurationEle = OdfElement.findFirstChildNode(MetaEditingDurationElement.class, mOfficeMetaElement); if (editiingDurationEle == null) { editiingDurationEle = mOfficeMetaElement.newMetaEditingDurationElement(); } editiingDurationEle.setTextContent(editingDuration.toString()); }
/** * Receives the value of the ODFDOM element representation * <code>MetaEditingDurationElement</code> , See {@odf.element * meta:editing-duration}. * * @return the total time spent editing the document; * <p> * <code>null</code>, if the element is not set. */ public Duration getEditingDuration() { MetaEditingDurationElement editiingDurationEle = OdfElement.findFirstChildNode(MetaEditingDurationElement.class, mOfficeMetaElement); if (editiingDurationEle != null) { return Duration.valueOf(editiingDurationEle.getTextContent()); } return null; }
try { DatatypeFactory aFactory = DatatypeFactory.newInstance(); metaData.setEditingDuration(new Duration(aFactory.newDurationDayTime(editingDuration))); } catch (DatatypeConfigurationException e) { Logger.getLogger(Document.class.getName()).log(Level.SEVERE,
/** * Sets the value of the ODFDOM element representation * <code>MetaEditingDurationElement</code> , See {@odf.element * meta:editing-duration}. * * @param editingDuration the time need to set. NULL will remove the element from the meta.xml. */ public void setEditingDuration(Duration editingDuration) { MetaEditingDurationElement editingDurationEle = OdfElement.findFirstChildNode(MetaEditingDurationElement.class, mOfficeMetaElement); if (editingDuration == null) { if (editingDurationEle != null) { mOfficeMetaElement.removeChild(editingDurationEle); } } else { if (editingDurationEle == null) { editingDurationEle = mOfficeMetaElement.newMetaEditingDurationElement(); } editingDurationEle.setTextContent(editingDuration.toString()); } }
/** * Receives the value of the odf dom element representation * <code>MetaEditingDurationElement</code>. * * @return the total time spent editing the document; * <p> * <code>null</code>, if the element is not set. * @see org.odftoolkit.odfdom.dom.element.meta.MetaEditingDurationElement */ public Duration getEditingDuration() { MetaEditingDurationElement editiingDurationEle = OdfElement.findFirstChildNode(MetaEditingDurationElement.class, mOfficeMetaElement); if (editiingDurationEle != null) { return Duration.valueOf(editiingDurationEle.getTextContent()); } return null; }
try { DatatypeFactory aFactory = DatatypeFactory.newInstance(); metaData.setEditingDuration(new Duration(aFactory.newDurationDayTime(editingDuration))); } catch (DatatypeConfigurationException e) { Logger.getLogger(Document.class.getName()).log(Level.SEVERE,
/** * Sets the value of the ODFDOM element representation * <code>MetaEditingDurationElement</code> , See {@odf.element * meta:editing-duration}. * * @param editingDuration the time need to set. NULL will remove the element from the meta.xml. */ public void setEditingDuration(Duration editingDuration) { MetaEditingDurationElement editingDurationEle = OdfElement.findFirstChildNode(MetaEditingDurationElement.class, mOfficeMetaElement); if (editingDuration == null) { if (editingDurationEle != null) { mOfficeMetaElement.removeChild(editingDurationEle); } } else { if (editingDurationEle == null) { editingDurationEle = mOfficeMetaElement.newMetaEditingDurationElement(); } editingDurationEle.setTextContent(editingDuration.toString()); } }
/** * Receives the value of the odf dom element representation * <code>MetaEditingDurationElement</code>. * * @return the total time spent editing the document; * <p> * <code>null</code>, if the element is not set. * @see org.odftoolkit.odfdom.dom.element.meta.MetaEditingDurationElement */ public Duration getEditingDuration() { MetaEditingDurationElement editiingDurationEle = OdfElement.findFirstChildNode(MetaEditingDurationElement.class, mOfficeMetaElement); if (editiingDurationEle != null) { return Duration.valueOf(editiingDurationEle.getTextContent()); } return null; }
try { DatatypeFactory aFactory = DatatypeFactory.newInstance(); metaData.setEditingDuration(new Duration(aFactory.newDurationDayTime(editingDuration))); } catch (DatatypeConfigurationException e) { Logger.getLogger(Document.class.getName()).log(Level.SEVERE,
/** * Sets the value of the ODFDOM element representation * <code>MetaEditingDurationElement</code> , See {@odf.element * meta:editing-duration}. * * @param editingDuration the time need to set. NULL will remove the element from the meta.xml. */ public void setEditingDuration(Duration editingDuration) { MetaEditingDurationElement editingDurationEle = OdfElement.findFirstChildNode(MetaEditingDurationElement.class, mOfficeMetaElement); if (editingDuration == null) { if (editingDurationEle != null) { mOfficeMetaElement.removeChild(editingDurationEle); } } else { if (editingDurationEle == null) { editingDurationEle = mOfficeMetaElement.newMetaEditingDurationElement(); } editingDurationEle.setTextContent(editingDuration.toString()); } }
/** * Receives the value of the ODFDOM element representation * <code>MetaEditingDurationElement</code> , See {@odf.element * meta:editing-duration}. * * @return the total time spent editing the document; * <p> * <code>null</code>, if the element is not set. */ public Duration getEditingDuration() { MetaEditingDurationElement editiingDurationEle = OdfElement.findFirstChildNode(MetaEditingDurationElement.class, mOfficeMetaElement); if (editiingDurationEle != null) { return Duration.valueOf(editiingDurationEle.getTextContent()); } return null; }
try { DatatypeFactory aFactory = DatatypeFactory.newInstance(); metaData.setEditingDuration(new Duration(aFactory.newDurationDayTime(editingDuration))); } catch (DatatypeConfigurationException e) { Logger.getLogger(OdfDocument.class.getName()).log(Level.SEVERE,