Package org.apache.felix.scrplugin

Examples of org.apache.felix.scrplugin.SCRDescriptorException


        try {
            final XmlHandler xmlHandler = new XmlHandler(classLoader, iLog, location);
            IOUtils.parse(file, xmlHandler);
            return xmlHandler.components;
        } catch (final TransformerException e) {
            throw new SCRDescriptorException("Unable to read xml", location, e);
        }
    }
View Full Code Here


            module.getOptions().setSpecVersion(sv);
            final File useFile = new File(descriptorDir, ccc.className + ".xml");
            try {
                ComponentDescriptorIO.generateXML(module, ccc.components, useFile, logger);
            } catch (final IOException e) {
                throw new SCRDescriptorException("Unable to generate xml", useFile.toString(), e);
            } catch (final TransformerException e) {
                throw new SCRDescriptorException("Unable to generate xml", useFile.toString(), e);
            } catch (final SAXException e) {
                throw new SCRDescriptorException("Unable to generate xml", useFile.toString(), e);
            }
            fileNames.add(PARENT_NAME + '/' + useFile.getName());

            module.getOptions().setSpecVersion(globalVersion);
        }
View Full Code Here

            final FileOutputStream fos = new FileOutputStream(fileName);
            fos.write(writer.toByteArray());
            fos.close();
        } catch (final Exception e) {
            throw new SCRDescriptorException("Unable to add methods to " + className, typeName, e);
        }
    }
View Full Code Here

                        pd.setValue(value);
                        pd.setType(propType);
                        pd.setUnbounded(PropertyUnbounded.DEFAULT);
                    } else {
                        if ( propType != found.getType() ) {
                            throw new SCRDescriptorException("Multi value property '" + key + "' has different types: "
                                    + found.getType() + " & " + propType,
                                    describedClass.getSource());
                        }
                        if ( found.getValue() != null ) {
                            final String[] values = new String[2];
                            values[0] = found.getValue();
                            values[1] = value;
                            found.setMultiValue(values);
                        } else {
                            final String[] oldValues = found.getMultiValue();
                            final String[] newValues = new String[oldValues.length + 1];
                            System.arraycopy(oldValues, 0, newValues, 0, oldValues.length);
                            newValues[oldValues.length] = value;
                            found.setMultiValue(newValues);
                        }
                    }
                }
            }
        }
        // TODO: properties

        // xmlns
        if (cad.getValue("xmlns") != null) {
            final SpecVersion spec = SpecVersion.fromNamespaceUrl(cad.getValue("xmlns").toString());
            if ( spec == null ) {
                throw new SCRDescriptorException("Unknown xmlns attribute value: " + cad.getValue("xmlns"),
                                describedClass.getSource());
            }
            component.setSpecVersion(spec);
        }
View Full Code Here

TOP

Related Classes of org.apache.felix.scrplugin.SCRDescriptorException

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.