Package org.milyn

Examples of org.milyn.SmooksException


        }

        try {
            config = ExtensionContext.getExtensionContext(executionContext).getResourceStack().peek();
        } catch (EmptyStackException e) {
            throw new SmooksException("No SmooksResourceConfiguration available in ExtensionContext stack.  Unable to set SmooksResourceConfiguration property '" + actualMapTo + "' with attribute '" + attribute + "' value '" + value + "'.");
        }

        if (value == null) {
            value = defaultValue;
        }
View Full Code Here


        SmooksResourceConfiguration config;

        try {
            config = ExtensionContext.getExtensionContext(executionContext).getResourceStack().peek();
        } catch (EmptyStackException e) {
            throw new SmooksException("No SmooksResourceConfiguration available in ExtensionContext stack.  Unable to set SmooksResourceConfiguration property '" + setOn + "' with static value.");
        }

        logger.debug("Setting property '" + setOn + "' on resource configuration to a value of '" + value + "'.");

        ResourceConfigUtil.setProperty(config, setOn, value, executionContext);
View Full Code Here

        NamespaceMappings.setNamespaceDeclarationStack(nsStack, nestedExecutionContext);

        SmooksContentHandler parentContentHandler = SmooksContentHandler.getHandler(executionContext);

        if(parentContentHandler.getNestedContentHandler() != null) {
            throw new SmooksException("Illegal use of more than one nested content handler fired on the same element.");
        }

        SmooksContentHandler nestedContentHandler = new SAXHandler(nestedExecutionContext, element.getWriter(this), parentContentHandler);

        DynamicSAXElementVisitorList.propogateDynamicVisitors(executionContext, nestedExecutionContext);
View Full Code Here

            synchronized (this) {
                if(smooksInstance == null) {
                    try {
                        smooksInstance = new Smooks(smooksConfig);
                    } catch (Exception e) {
                        throw new SmooksException("Error creating nested Smooks instance for Smooks configuration '" + smooksConfig + "'.", e);
                    }
                }
            }
        }
        return smooksInstance;
View Full Code Here

                return streamToReader(streamSource.getInputStream(), contentEncoding);
        } else if (streamSource.getSystemId() != null) {
          return systemIdToReader(streamSource.getSystemId(), contentEncoding);
        }
             
              throw new SmooksException("Invalid " + StreamSource.class.getName() + ".  No InputStream, Reader or SystemId instance.");
      } else if (source.getSystemId() != null) {
        return systemIdToReader(source.getSystemId(), contentEncoding);
      }
      }
     
View Full Code Here

    private static InputStream systemIdToStream(String systemId) {
        try {
            return systemIdToURL(systemId).openStream();
        } catch (IOException e) {
            throw new SmooksException("Invalid System ID on StreamSource: '" + systemId + "'.  Unable to open stream to resource.", e);
        }
    }
View Full Code Here

  private static URL systemIdToURL(final String systemId)
  {
    try {
      return new URL(systemId);
    } catch (MalformedURLException e) {
        throw new SmooksException("Invalid System ID on StreamSource: '" + systemId + "'.  Must be a valid URL.", e);
    }
     
  }
View Full Code Here

            return new InputStreamReader(inputStream, contentEncoding);
        } else {
            return new InputStreamReader(inputStream, "UTF-8");
        }
    } catch (UnsupportedEncodingException e) {
        throw new SmooksException("Unable to decode input stream.", e);
    }
  }
View Full Code Here

            inputStream = getInputStream(streamSource);
            reader = streamSource.getReader();
            if(reader == null) {
                if(inputStream == null) {
                    throw new SmooksException("Invalid StreamSource.  Unable to extract an InputStream (even by systemId) or Reader instance.");
                }
                reader = streamToReader(inputStream, contentEncoding);
            }

            InputSource inputSource = new InputSource();
View Full Code Here

                    return new OutputStreamWriter(streamResult.getOutputStream(), executionContext.getContentEncoding());
                } else {
                    return new OutputStreamWriter(streamResult.getOutputStream(), "UTF-8");
                }
            } catch (UnsupportedEncodingException e) {
                throw new SmooksException("Unable to encode output stream.", e);
            }
        } else {
            throw new SmooksException("Invalid " + StreamResult.class.getName() + ".  No OutputStream or Writer instance.");
        }
    }
View Full Code Here

TOP

Related Classes of org.milyn.SmooksException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.