Package org.apache.isis.core.commons.exceptions

Examples of org.apache.isis.core.commons.exceptions.IsisException


    private void close(final BufferedReader reader) {
        if (reader != null) {
            try {
                reader.close();
            } catch (final IOException e) {
                throw new IsisException(e);
            }
        }
    }
View Full Code Here


    }

    private InputStream getInstallerRegistryStream(final String componentFile) {
        final InputStream in = IsisInstallerRegistry.getPropertiesAsStream();
        if (in == null) {
            throw new IsisException("No resource found: " + componentFile);
        }
        return in;
    }
View Full Code Here

            final Properties p = new Properties();
            p.load(resourceAsStream);
            final String version = p.getProperty("version");
            return version;
        } catch (final IOException e) {
            throw new IsisException(e);
        }
    }
View Full Code Here

        super(new Frame());
        parent = (Frame) getParent();
        final String imageName = AboutIsis.getImageName();
        final TemplateImage templateImage = loader.getTemplateImage(imageName);
        if (templateImage == null) {
            throw new IsisException("Failed to find splash image " + imageName);
        }
        logo = templateImage.getImage();

        textFont = new Font("SansSerif", Font.PLAIN, 10);
        titleFont = new Font("SansSerif", Font.BOLD, 11);
View Full Code Here

        this.objectAdapterLookup = adapterManager;
        this.localization = localization;
        this.authenticationSession = authenticationSession;
       
        if (pojo instanceof ObjectAdapter) {
            throw new IsisException("Adapter can't be used to adapt an adapter: " + pojo);
        }
        this.pojo = pojo;
        this.oid = oid;
        resolveState = ResolveState.NEW;
    }
View Full Code Here

                return (String) type.getMethod("toPlainString", (Class[]) null).invoke(object, (Object[]) null);
            } catch (final NoSuchMethodException nsm) {
                return (String) type.getMethod("toString", (Class[]) null).invoke(object, (Object[]) null);
            }
        } catch (final Exception e) {
            throw new IsisException(e);
        }

    }
View Full Code Here

            for (final Class<? extends FacetFactory> facetFactorie : facetFactories) {
                FacetFactory facetFactory = null;
                try {
                    facetFactory = facetFactorie.newInstance();
                } catch (final InstantiationException e) {
                    throw new IsisException(e);
                } catch (final IllegalAccessException e) {
                    throw new IsisException(e);
                }
                getFacetProcessor().injectDependenciesInto(facetFactory);
                facetFactory.process(new ProcessClassContext(introspectedClass, metadataProperties, methodRemover, spec));
            }
        }
View Full Code Here

            case 'T':
                return Boolean.TRUE;
            case 'F':
                return Boolean.FALSE;
            default:
                throw new IsisException("Invalid data for logical, expected 'T', 'F' or 'N, but got " + data.charAt(0));
            }
        } else if (dataLength == 4 || dataLength == 5) {
            switch (data.charAt(0)) {
            case 't':
                return Boolean.TRUE;
            case 'f':
                return Boolean.FALSE;
            default:
                throw new IsisException("Invalid data for logical, expected 't' or 'f', but got " + data.charAt(0));
            }
        }
        throw new IsisException("Invalid data for logical, expected 1, 4 or 5 bytes, got " + dataLength + ": " + data);
    }
View Full Code Here

            pw.write("\n");
            writer.write(pw);
            pw.write("\n");
            pw.close();
        } catch (final IOException e) {
            throw new IsisException("Problems writing data files", e);
        }
    }
View Full Code Here

                parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
            } catch (final SAXException e2) {
                try {
                    parser = XMLReaderFactory.createXMLReader("org.apache.crimson.parser.XMLReaderImpl");
                } catch (final SAXException failed) {
                    throw new IsisException("Couldn't locate a SAX parser");
                }
            }
        }

        final File file = file(fileName);
        try {
            parser.setContentHandler(handler);
            final FileInputStream fis = new FileInputStream(file);
            final InputStreamReader isr = new InputStreamReader(fis, charset);
            final InputSource is = new InputSource(isr);
            parser.parse(is);

            return true;
        } catch (final FileNotFoundException e) {
            return false;
        } catch (final IOException e) {
            throw new IsisException("Error reading XML file", e);
        } catch (final SAXParseException e) {
            throw new IsisException("Error while parsing: " + e.getMessage() + " in " + file + ")", e);
        } catch (final SAXException e) {
            throw new IsisException("Error in file " + file + " ", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.commons.exceptions.IsisException

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.