protected XSLFTextRun(XmlObject r, XSLFTextParagraph p){ _r = r; _p = p; if (!(r instanceof CTRegularTextRun || r instanceof CTTextLineBreak || r instanceof CTTextField)) { throw new OpenXML4JRuntimeException("unsupported text run of type "+r.getClass()); } }
private static ContentType newCorePropertiesPart() { try { return new ContentType(ContentTypes.CORE_PROPERTIES_PART); } catch (InvalidFormatException e) { // Should never happen throw new OpenXML4JRuntimeException( "Package.init() : this exception should never happen, " + "if you read this message please send a mail to the developers team. : " + e.getMessage(), e ); } }
} else { if (!PackagingURIHelper.PACKAGE_ROOT_URI.equals(partURI)) { throw new OpenXML4JRuntimeException( "OCP conformance must be check for ALL part name except special cases : ['/']");
/** * Constructor. Makes a ValidPartName object from a java.net.URI * * @param uri * The URI to validate and to transform into ValidPartName. * @param checkConformance * Flag to specify if the constructor have to validate the OPC * conformance. Must be always <code>true</code> except for * special URI like '/' which is needed for internal use by * OpenXML4J but is not valid. * @throws InvalidFormatException * Throw if the specified part name is not conform to Open * Packaging Convention specifications. * @see java.net.URI */ PackagePartName(URI uri, boolean checkConformance) throws InvalidFormatException { if (checkConformance) { throwExceptionIfInvalidPartUri(uri); } else { if (!PackagingURIHelper.PACKAGE_ROOT_URI.equals(uri)) { throw new OpenXML4JRuntimeException( "OCP conformance must be check for ALL part name except special cases : ['/']"); } } this.partNameURI = uri; this.isRelationship = isRelationshipPartURI(this.partNameURI); }
throw new OpenXML4JRuntimeException( "Rule M2.4 exception : Part \'" + partName
packagePart.setContentType(newContentType); } catch (InvalidFormatException e) { throw new OpenXML4JRuntimeException("invalid content type - "+newContentType, e);
throw new OpenXML4JRuntimeException( "Fail to save: an error occurs while saving the package : " + e.getMessage(), e);
protected XSLFTextRun(XmlObject r, XSLFTextParagraph p){ _r = r; _p = p; if (!(r instanceof CTRegularTextRun || r instanceof CTTextLineBreak || r instanceof CTTextField)) { throw new OpenXML4JRuntimeException("unsupported text run of type "+r.getClass()); } }
private static ContentType newCorePropertiesPart() { try { return new ContentType(ContentTypes.CORE_PROPERTIES_PART); } catch (InvalidFormatException e) { // Should never happen throw new OpenXML4JRuntimeException( "Package.init() : this exception should never happen, " + "if you read this message please send a mail to the developers team. : " + e.getMessage(), e ); } }
} else { if (!PackagingURIHelper.PACKAGE_ROOT_URI.equals(partURI)) { throw new OpenXML4JRuntimeException( "OCP conformance must be check for ALL part name except special cases : ['/']");
} else { if (!PackagingURIHelper.PACKAGE_ROOT_URI.equals(partURI)) { throw new OpenXML4JRuntimeException( "OCP conformance must be check for ALL part name except special cases : ['/']");
/** * Constructor. Makes a ValidPartName object from a java.net.URI * * @param uri * The URI to validate and to transform into ValidPartName. * @param checkConformance * Flag to specify if the constructor have to validate the OPC * conformance. Must be always <code>true</code> except for * special URI like '/' which is needed for internal use by * OpenXML4J but is not valid. * @throws InvalidFormatException * Throw if the specified part name is not conform to Open * Packaging Convention specifications. * @see java.net.URI */ PackagePartName(URI uri, boolean checkConformance) throws InvalidFormatException { if (checkConformance) { throwExceptionIfInvalidPartUri(uri); } else { if (!PackagingURIHelper.PACKAGE_ROOT_URI.equals(uri)) { throw new OpenXML4JRuntimeException( "OCP conformance must be check for ALL part name except special cases : ['/']"); } } this.partNameURI = uri; this.isRelationship = isRelationshipPartURI(this.partNameURI); }
/** * Constructor. Makes a ValidPartName object from a java.net.URI * * @param uri * The URI to validate and to transform into ValidPartName. * @param checkConformance * Flag to specify if the contructor have to validate the OPC * conformance. Must be always <code>true</code> except for * special URI like '/' which is needed for internal use by * OpenXML4J but is not valid. * @throws InvalidFormatException * Throw if the specified part name is not conform to Open * Packaging Convention specifications. * @see java.net.URI */ PackagePartName(URI uri, boolean checkConformance) throws InvalidFormatException { if (checkConformance) { throwExceptionIfInvalidPartUri(uri); } else { if (!PackagingURIHelper.PACKAGE_ROOT_URI.equals(uri)) { throw new OpenXML4JRuntimeException( "OCP conformance must be check for ALL part name except special cases : ['/']"); } } this.partNameURI = uri; this.isRelationship = isRelationshipPartURI(this.partNameURI); }
throw new OpenXML4JRuntimeException( "Rule M2.4 exception : this error should NEVER happen, if so please send a mail to the developers team, thanks !");
throw new OpenXML4JRuntimeException( "Rule M2.4 exception : Part \'" + partName
/** * Initialize the package instance. */ private void init() { this.partMarshallers = new Hashtable<ContentType, PartMarshaller>(5); this.partUnmarshallers = new Hashtable<ContentType, PartUnmarshaller>(2); try { // Add 'default' unmarshaller this.partUnmarshallers.put(new ContentType( ContentTypes.CORE_PROPERTIES_PART), new PackagePropertiesUnmarshaller()); // Add default marshaller this.defaultPartMarshaller = new DefaultMarshaller(); // TODO Delocalize specialized marshallers this.partMarshallers.put(new ContentType( ContentTypes.CORE_PROPERTIES_PART), new ZipPackagePropertiesMarshaller()); } catch (InvalidFormatException e) { // Should never happen throw new OpenXML4JRuntimeException( "Package.init() : this exception should never happen, " + "if you read this message please send a mail to the developers team. : " + e.getMessage() ); } }
packagePart.setContentType(newContentType); } catch (InvalidFormatException e) { throw new OpenXML4JRuntimeException("invalid content type - "+newContentType, e);
throw new OpenXML4JRuntimeException( "Fail to save: an error occurs while saving the package : " + e.getMessage(), e);
throw new OpenXML4JRuntimeException( "Fail to save: an error occurs while saving the package : " + e.getMessage(), e);