private List buildEjbEntries()

in src/main/java/org/apache/maven/plugins/ear/GenerateApplicationXmlMojo.java [366:399]


    private List<EjbRef> buildEjbEntries() throws EarPluginException {
        final List<EjbRef> result = new ArrayList<>();
        if (ejbRefs == null) {
            return result;
        }
        try {
            StringSearchInterpolator ssi = new StringSearchInterpolator();
            ValueSource vs = new MapBasedValueSource(project.getProperties());
            ssi.addValueSource(vs);

            final PlexusConfiguration[] allEjbEntries = ejbRefs.getChildren(EjbRef.EJB_REF);

            for (PlexusConfiguration ejbEntry : allEjbEntries) {
                final String childDescription =
                        interpolate(ssi, ejbEntry.getChild(EnvEntry.DESCRIPTION).getValue());
                final String childEjbEntryName =
                        interpolate(ssi, ejbEntry.getChild(EjbRef.EJB_NAME).getValue());
                final String childEjbEntryType =
                        interpolate(ssi, ejbEntry.getChild(EjbRef.EJB_TYPE).getValue());
                final String childEjbLookupNameValue = interpolate(
                        ssi, ejbEntry.getChild(EjbRef.EJB_LOOKUP_NAME).getValue());

                try {
                    result.add(new EjbRef(
                            childDescription, childEjbEntryName, childEjbEntryType, childEjbLookupNameValue));
                } catch (IllegalArgumentException e) {
                    throw new EarPluginException("Invalid ejb-ref [" + ejbEntry + "]", e);
                }
            }
            return result;
        } catch (InterpolationException e) {
            throw new EarPluginException("Interpolation exception:", e);
        }
    }