/** * The image path will be stored as URI of the href attribute * * @param packagePath The relative path from the package root to the image */ public void setImagePath(String packagePath) { try { packagePath = packagePath.replaceFirst(mOdfSchemaDocument.getDocumentPath(), ""); URI uri = new URI(AnyURI.encodePath(packagePath).toString()); this.setXlinkHrefAttribute(AnyURI.decodePath(uri.toString())); mImageURI = uri; } catch (URISyntaxException ex) { Logger.getLogger(OdfDrawImage.class.getName()).log(Level.SEVERE, null, ex); } }
/** * set uri value for URIorSafeCURIE Object * * @param uri * the anyURI value which is set to URIorSafeCURIE Object */ public void setAnyURI(URI uri) { mValue = new AnyURI(uri); }
/** * get the anyURI value of this URIorSafeCURIE Object * * @return the anyURI value of this URIorSafeCURIE Object */ public URI getAnyURI() { if (isSafeCURIE()) { throw new IllegalArgumentException("I do not have a AnyURI value"); } else if (mValue != null) { return ((AnyURI) mValue).getURI(); } else { return null; } }
/** * Return the URI for this image * @return the URI of image */ public URI getImageUri() { try { if (mImageURI == null) { mImageURI = new URI(AnyURI.encodePath(this.getXlinkHrefAttribute().toString())); } } catch (URISyntaxException ex) { Logger.getLogger(OdfDrawImage.class.getName()).log(Level.SEVERE, null, ex); } return mImageURI; }
/** * Copy Construct URIorSafeCURIE with the same value of val * * @param val * the copied URIorSafeCURIE object * @throws IllegalArgumentException if the given argument is not a valid URIorSaveCURIE */ public URIorSafeCURIE(URIorSafeCURIE val) { if (val == null) { throw new IllegalArgumentException("parameter can not be null for URIorSafeCURIE"); } if (val.isSafeCURIE()) { mURIorSafeCURIE = val.getSafeCURIE(); } else { mURIorSafeCURIE = (new AnyURI(val.getAnyURI())).toString(); } }
/** * Returns an URIorSafeCURIE instance representing the specified String * value * * @param stringValue * a String value * @return return an URIorSafeCURIE instance representing stringValue * @throws IllegalArgumentException if the given argument is not a valid URIorSaveCURIE */ public static URIorSafeCURIE valueOf(String stringValue) throws IllegalArgumentException { if (stringValue == null) { throw new IllegalArgumentException("parameter can not be null for URIorSafeCURIE"); } URIorSafeCURIE aRet = new URIorSafeCURIE(); if ((uRIorSafeCURIEPattern.matcher(stringValue).matches()) && (stringValue.length() >= 3)) { aRet.setSafeCURIE(stringValue); } else { AnyURI aAnyURI = AnyURI.valueOf(stringValue); if (aAnyURI != null) { aRet.setAnyURI(aAnyURI.getURI()); } else { throw new IllegalArgumentException("parameter is invalid for datatype URIorSafeCURIE"); } } return aRet; }
/** * check if the specified XMLGregorianCalendar {@odf.datatype URIorSafeCURIE} is a valid * URIorSafeCURIE data type * * @param stringValue * the value to be tested * @return true if the value of argument is valid for {@odf.datatype URIorSafeCURIE} data * type false otherwise */ public static boolean isValid(String stringValue) { if (SafeCURIE.isValid(stringValue)) { return true; } else if (AnyURI.valueOf(stringValue) != null) { return true; } else { return false; } } }
/** * Return the URI for this image * @return the URI of image */ public URI getImageUri() { try { if (mImageURI == null) { mImageURI = new URI(AnyURI.encodePath(this.getXlinkHrefAttribute().toString())); } } catch (URISyntaxException ex) { Logger.getLogger(OdfDrawImage.class.getName()).log(Level.SEVERE, null, ex); } return mImageURI; }
/** * Copy Construct URIorSafeCURIE with the same value of val * * @param val * the copied URIorSafeCURIE object * @throws IllegalArgumentException if the given argument is not a valid URIorSaveCURIE */ public URIorSafeCURIE(URIorSafeCURIE val) { if (val == null) { throw new IllegalArgumentException("parameter can not be null for URIorSafeCURIE"); } if (val.isSafeCURIE()) { mURIorSafeCURIE = val.getSafeCURIE(); } else { mURIorSafeCURIE = (new AnyURI(val.getAnyURI())).toString(); } }
/** * Returns an URIorSafeCURIE instance representing the specified String * value * * @param stringValue * a String value * @return return an URIorSafeCURIE instance representing stringValue * @throws IllegalArgumentException if the given argument is not a valid URIorSaveCURIE */ public static URIorSafeCURIE valueOf(String stringValue) throws IllegalArgumentException { if (stringValue == null) { throw new IllegalArgumentException("parameter can not be null for URIorSafeCURIE"); } URIorSafeCURIE aRet = new URIorSafeCURIE(); if ((uRIorSafeCURIEPattern.matcher(stringValue).matches()) && (stringValue.length() >= 3)) { aRet.setSafeCURIE(stringValue); } else { AnyURI aAnyURI = AnyURI.valueOf(stringValue); if (aAnyURI != null) { aRet.setAnyURI(aAnyURI.getURI()); } else { throw new IllegalArgumentException("parameter is invalid for datatype URIorSafeCURIE"); } } return aRet; }
/** * check if the specified XMLGregorianCalendar {@odf.datatype URIorSafeCURIE} is a valid * URIorSafeCURIE data type * * @param stringValue * the value to be tested * @return true if the value of argument is valid for {@odf.datatype URIorSafeCURIE} data * type false otherwise */ public static boolean isValid(String stringValue) { if (SafeCURIE.isValid(stringValue)) { return true; } else if (AnyURI.valueOf(stringValue) != null) { return true; } else { return false; } } }
/** * The image path will be stored as URI of the href attribute * * @param packagePath The relative path from the package root to the image */ public void setImagePath(String packagePath) { try { packagePath = packagePath.replaceFirst(mOdfSchemaDocument.getDocumentPath(), ""); URI uri = new URI(AnyURI.encodePath(packagePath).toString()); this.setXlinkHrefAttribute(AnyURI.decodePath(uri.toString())); mImageURI = uri; } catch (URISyntaxException ex) { Logger.getLogger(OdfDrawImage.class.getName()).log(Level.SEVERE, null, ex); } }
/** * Return the URI for this image * @return the URI of image */ public URI getImageUri() { try { if (mImageURI == null) { mImageURI = new URI(AnyURI.encodePath(this.getXlinkHrefAttribute().toString())); } } catch (URISyntaxException ex) { Logger.getLogger(OdfDrawImage.class.getName()).log(Level.SEVERE, null, ex); } return mImageURI; }
/** * Copy Construct URIorSafeCURIE with the same value of val * * @param val * the copied URIorSafeCURIE object * @throws IllegalArgumentException if the given argument is not a valid URIorSaveCURIE */ public URIorSafeCURIE(URIorSafeCURIE val) { if (val == null) { throw new IllegalArgumentException("parameter can not be null for URIorSafeCURIE"); } if (val.isSafeCURIE()) { mURIorSafeCURIE = val.getSafeCURIE(); } else { mURIorSafeCURIE = (new AnyURI(val.getAnyURI())).toString(); } }
/** * Returns an URIorSafeCURIE instance representing the specified String * value * * @param stringValue * a String value * @return return an URIorSafeCURIE instance representing stringValue * @throws IllegalArgumentException if the given argument is not a valid URIorSaveCURIE */ public static URIorSafeCURIE valueOf(String stringValue) throws IllegalArgumentException { if (stringValue == null) { throw new IllegalArgumentException("parameter can not be null for URIorSafeCURIE"); } URIorSafeCURIE aRet = new URIorSafeCURIE(); if ((uRIorSafeCURIEPattern.matcher(stringValue).matches()) && (stringValue.length() >= 3)) { aRet.setSafeCURIE(stringValue); } else { AnyURI aAnyURI = AnyURI.valueOf(stringValue); if (aAnyURI != null) { aRet.setAnyURI(aAnyURI.getURI()); } else { throw new IllegalArgumentException("parameter is invalid for datatype URIorSafeCURIE"); } } return aRet; }
/** * set uri value for URIorSafeCURIE Object * * @param uri * the anyURI value which is set to URIorSafeCURIE Object */ public void setAnyURI(URI uri) { mValue = new AnyURI(uri); }
/** * get the anyURI value of this URIorSafeCURIE Object * * @return the anyURI value of this URIorSafeCURIE Object */ public URI getAnyURI() { if (isSafeCURIE()) { throw new IllegalArgumentException("I do not have a AnyURI value"); } else if (mValue != null) { return ((AnyURI) mValue).getURI(); } else { return null; } }
/** * check if the specified XMLGregorianCalendar {@odf.datatype URIorSafeCURIE} is a valid * URIorSafeCURIE data type * * @param stringValue * the value to be tested * @return true if the value of argument is valid for {@odf.datatype URIorSafeCURIE} data * type false otherwise */ public static boolean isValid(String stringValue) { if (SafeCURIE.isValid(stringValue)) { return true; } else if (AnyURI.valueOf(stringValue) != null) { return true; } else { return false; } } }
/** * The image path will be stored as URI of the href attribute * * @param packagePath The relative path from the package root to the image */ public void setImagePath(String packagePath) { try { packagePath = packagePath.replaceFirst(mOdfSchemaDocument.getDocumentPath(), ""); URI uri = new URI(AnyURI.encodePath(packagePath).toString()); this.setXlinkHrefAttribute(AnyURI.decodePath(uri.toString())); mImageURI = uri; } catch (URISyntaxException ex) { Logger.getLogger(OdfDrawImage.class.getName()).log(Level.SEVERE, null, ex); } }
/** * set uri value for URIorSafeCURIE Object * * @param uri * the anyURI value which is set to URIorSafeCURIE Object */ public void setAnyURI(URI uri) { mValue = new AnyURI(uri); }