You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-dev@incubator.apache.org by Gilles Scokart <gs...@gmail.com> on 2007/08/08 07:40:03 UTC

Re: svn commit: r563617 - in /incubator/ivy/core/trunk: src/java/org/apache/ivy/core/deliver/ src/java/org/apache/ivy/core/publish/ src/java/org/apache/ivy/core/settings/ src/java/org/apache/ivy/plugins/parser/ src/java/org/apache/ivy/plugins/parser/

This is the second commit in this direction (previous was done +/- 1
month ago if I remember well).  My goal was to reduce the dependencies
between the engine and the settings.  A side effect is that those
dependencies are now much more visible (so much easier to isolate and
refactor).

A thing I didn't expected was the amount of settings required by the
Parser (and currently passed via engine specific settings).

I will continue with the other engines.

The next step might be to:
- Replace reference engines->Ivy class by reference engine->required
engines (injected by the Ivy class).
- Consider the parser as an Engine (= injecting a ParserEngine into
the engines that requires parsing so that the Engine won't have
anymore a dependency on the ParserSettings).

WDYT?

Gilles


2007/8/7, gscokart@apache.org <gs...@apache.org>:
> Author: gscokart
> Date: Tue Aug  7 11:41:21 2007
> New Revision: 563617
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=563617
> Log:
> refactor to isolate settings specific to deliverEngine and PublishEngine (like in SortEngine)
>
> Added:
>     incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngineSettings.java   (with props)
>     incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngineSettings.java   (with props)
>     incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java   (with props)
> Modified:
>     incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java
>     incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngine.java
>     incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
>     incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
>     incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java
>     incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java
>     incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
>     incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
>     incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
>     incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistryTest.java
>
> Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java
> URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java?view=diff&rev=563617&r1=563616&r2=563617
> ==============================================================================
> --- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java (original)
> +++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java Tue Aug  7 11:41:21 2007
> @@ -35,7 +35,6 @@
>  import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
>  import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
>  import org.apache.ivy.core.module.id.ModuleRevisionId;
> -import org.apache.ivy.core.settings.IvySettings;
>  import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser;
>  import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorUpdater;
>  import org.apache.ivy.plugins.report.XmlReportParser;
> @@ -44,9 +43,9 @@
>  import org.xml.sax.SAXException;
>
>  public class DeliverEngine {
> -    private IvySettings settings;
> +    private DeliverEngineSettings settings;
>
> -    public DeliverEngine(IvySettings settings) {
> +    public DeliverEngine(DeliverEngineSettings settings) {
>          this.settings = settings;
>      }
>
>
> Added: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngineSettings.java
> URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngineSettings.java?view=auto&rev=563617
> ==============================================================================
> --- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngineSettings.java (added)
> +++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngineSettings.java Tue Aug  7 11:41:21 2007
> @@ -0,0 +1,26 @@
> +/*
> + *  Licensed to the Apache Software Foundation (ASF) under one or more
> + *  contributor license agreements.  See the NOTICE file distributed with
> + *  this work for additional information regarding copyright ownership.
> + *  The ASF licenses this file to You under the Apache License, Version 2.0
> + *  (the "License"); you may not use this file except in compliance with
> + *  the License.  You may obtain a copy of the License at
> + *
> + *      http://www.apache.org/licenses/LICENSE-2.0
> + *
> + *  Unless required by applicable law or agreed to in writing, software
> + *  distributed under the License is distributed on an "AS IS" BASIS,
> + *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + *  See the License for the specific language governing permissions and
> + *  limitations under the License.
> + *
> + */
> +package org.apache.ivy.core.deliver;
> +
> +import org.apache.ivy.plugins.parser.ParserSettings;
> +
> +public interface DeliverEngineSettings extends ParserSettings {
> +
> +    String substitute(String destIvyPattern);
> +
> +}
>
> Propchange: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngineSettings.java
> ------------------------------------------------------------------------------
>     svn:eol-style = native
>
> Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngine.java
> URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngine.java?view=diff&rev=563617&r1=563616&r2=563617
> ==============================================================================
> --- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngine.java (original)
> +++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngine.java Tue Aug  7 11:41:21 2007
> @@ -39,7 +39,6 @@
>  import org.apache.ivy.core.module.descriptor.MDArtifact;
>  import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
>  import org.apache.ivy.core.module.id.ModuleRevisionId;
> -import org.apache.ivy.core.settings.IvySettings;
>  import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser;
>  import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorUpdater;
>  import org.apache.ivy.plugins.resolver.DependencyResolver;
> @@ -48,9 +47,9 @@
>  import org.xml.sax.SAXException;
>
>  public class PublishEngine {
> -    private IvySettings settings;
> +    private PublishEngineSettings settings;
>
> -    public PublishEngine(IvySettings settings) {
> +    public PublishEngine(PublishEngineSettings settings) {
>          this.settings = settings;
>      }
>
>
> Added: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngineSettings.java
> URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngineSettings.java?view=auto&rev=563617
> ==============================================================================
> --- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngineSettings.java (added)
> +++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngineSettings.java Tue Aug  7 11:41:21 2007
> @@ -0,0 +1,32 @@
> +/*
> + *  Licensed to the Apache Software Foundation (ASF) under one or more
> + *  contributor license agreements.  See the NOTICE file distributed with
> + *  this work for additional information regarding copyright ownership.
> + *  The ASF licenses this file to You under the Apache License, Version 2.0
> + *  (the "License"); you may not use this file except in compliance with
> + *  the License.  You may obtain a copy of the License at
> + *
> + *      http://www.apache.org/licenses/LICENSE-2.0
> + *
> + *  Unless required by applicable law or agreed to in writing, software
> + *  distributed under the License is distributed on an "AS IS" BASIS,
> + *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + *  See the License for the specific language governing permissions and
> + *  limitations under the License.
> + *
> + */
> +package org.apache.ivy.core.publish;
> +
> +import org.apache.ivy.plugins.parser.ParserSettings;
> +import org.apache.ivy.plugins.resolver.DependencyResolver;
> +
> +/**
> + * Settings specific to the publish engine
> + */
> +public interface PublishEngineSettings extends ParserSettings {
> +
> +    String substitute(String srcIvyPattern);
> +
> +    DependencyResolver getResolver(String resolverName);
> +
> +}
>
> Propchange: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngineSettings.java
> ------------------------------------------------------------------------------
>     svn:eol-style = native
>
> Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
> URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java?view=diff&rev=563617&r1=563616&r2=563617
> ==============================================================================
> --- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java (original)
> +++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java Tue Aug  7 11:41:21 2007
> @@ -40,8 +40,10 @@
>  import org.apache.ivy.core.IvyPatternHelper;
>  import org.apache.ivy.core.NormalRelativeUrlResolver;
>  import org.apache.ivy.core.RelativeUrlResolver;
> +import org.apache.ivy.core.deliver.DeliverEngineSettings;
>  import org.apache.ivy.core.module.id.ModuleId;
>  import org.apache.ivy.core.module.status.StatusManager;
> +import org.apache.ivy.core.publish.PublishEngineSettings;
>  import org.apache.ivy.core.sort.SortEngineSettings;
>  import org.apache.ivy.plugins.IvyAware;
>  import org.apache.ivy.plugins.IvySettingsAware;
> @@ -65,6 +67,7 @@
>  import org.apache.ivy.plugins.namespace.Namespace;
>  import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
>  import org.apache.ivy.plugins.parser.ModuleDescriptorParserRegistry;
> +import org.apache.ivy.plugins.parser.ParserSettings;
>  import org.apache.ivy.plugins.report.LogReportOutputter;
>  import org.apache.ivy.plugins.report.ReportOutputter;
>  import org.apache.ivy.plugins.report.XmlReportOutputter;
> @@ -81,7 +84,7 @@
>  import org.apache.ivy.util.Message;
>  import org.apache.ivy.util.url.URLHandlerRegistry;
>
> -public class IvySettings implements SortEngineSettings {
> +public class IvySettings implements SortEngineSettings , PublishEngineSettings , ParserSettings , DeliverEngineSettings {
>      private static final String DEFAULT_CACHE_ARTIFACT_PATTERN =
>          "[organisation]/[module]/[type]s/[artifact]-[revision](.[ext])";
>
>
> Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
> URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java?view=diff&rev=563617&r1=563616&r2=563617
> ==============================================================================
> --- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java (original)
> +++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java Tue Aug  7 11:41:21 2007
> @@ -32,7 +32,6 @@
>  import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
>  import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
>  import org.apache.ivy.core.module.id.ModuleRevisionId;
> -import org.apache.ivy.core.settings.IvySettings;
>  import org.apache.ivy.plugins.repository.Resource;
>  import org.apache.ivy.plugins.repository.url.URLResource;
>  import org.apache.ivy.util.Message;
> @@ -41,7 +40,7 @@
>  import org.xml.sax.helpers.DefaultHandler;
>
>  public abstract class AbstractModuleDescriptorParser implements ModuleDescriptorParser {
> -    public ModuleDescriptor parseDescriptor(IvySettings ivySettings, URL descriptorURL,
> +    public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL descriptorURL,
>              boolean validate) throws ParseException, IOException {
>          return parseDescriptor(ivySettings, descriptorURL,
>              new URLResource(descriptorURL), validate);
>
> Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java
> URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java?view=diff&rev=563617&r1=563616&r2=563617
> ==============================================================================
> --- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java (original)
> +++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java Tue Aug  7 11:41:21 2007
> @@ -24,14 +24,13 @@
>  import java.text.ParseException;
>
>  import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
> -import org.apache.ivy.core.settings.IvySettings;
>  import org.apache.ivy.plugins.repository.Resource;
>
>  public interface ModuleDescriptorParser {
> -    public ModuleDescriptor parseDescriptor(IvySettings ivySettings, URL descriptorURL,
> +    public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL descriptorURL,
>              boolean validate) throws ParseException, IOException;
>
> -    public ModuleDescriptor parseDescriptor(IvySettings ivySettings, URL descriptorURL,
> +    public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL descriptorURL,
>              Resource res, boolean validate) throws ParseException, IOException;
>
>      /**
>
> Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java
> URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java?view=diff&rev=563617&r1=563616&r2=563617
> ==============================================================================
> --- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java (original)
> +++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java Tue Aug  7 11:41:21 2007
> @@ -27,7 +27,6 @@
>  import java.util.List;
>
>  import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
> -import org.apache.ivy.core.settings.IvySettings;
>  import org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser;
>  import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser;
>  import org.apache.ivy.plugins.repository.Resource;
> @@ -76,7 +75,7 @@
>          return null;
>      }
>
> -    public ModuleDescriptor parseDescriptor(IvySettings settings, URL descriptorURL, Resource res,
> +    public ModuleDescriptor parseDescriptor(ParserSettings settings, URL descriptorURL, Resource res,
>              boolean validate) throws ParseException, IOException {
>          ModuleDescriptorParser parser = getParser(res);
>          if (parser == null) {
>
> Added: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java
> URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java?view=auto&rev=563617
> ==============================================================================
> --- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java (added)
> +++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java Tue Aug  7 11:41:21 2007
> @@ -0,0 +1,40 @@
> +/*
> + *  Licensed to the Apache Software Foundation (ASF) under one or more
> + *  contributor license agreements.  See the NOTICE file distributed with
> + *  this work for additional information regarding copyright ownership.
> + *  The ASF licenses this file to You under the Apache License, Version 2.0
> + *  (the "License"); you may not use this file except in compliance with
> + *  the License.  You may obtain a copy of the License at
> + *
> + *      http://www.apache.org/licenses/LICENSE-2.0
> + *
> + *  Unless required by applicable law or agreed to in writing, software
> + *  distributed under the License is distributed on an "AS IS" BASIS,
> + *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + *  See the License for the specific language governing permissions and
> + *  limitations under the License.
> + *
> + */
> +package org.apache.ivy.plugins.parser;
> +
> +import org.apache.ivy.core.RelativeUrlResolver;
> +import org.apache.ivy.core.module.status.StatusManager;
> +import org.apache.ivy.plugins.conflict.ConflictManager;
> +import org.apache.ivy.plugins.matcher.PatternMatcher;
> +import org.apache.ivy.plugins.namespace.Namespace;
> +
> +public interface ParserSettings {
> +
> +    String substitute(String value);
> +
> +    ConflictManager getConflictManager(String name);
> +
> +    PatternMatcher getMatcher(String matcherName);
> +
> +    Namespace getNamespace(String namespace);
> +
> +    StatusManager getStatusManager();
> +
> +    RelativeUrlResolver getRelativeUrlResolver();
> +
> +}
>
> Propchange: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java
> ------------------------------------------------------------------------------
>     svn:eol-style = native
>
> Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
> URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?view=diff&rev=563617&r1=563616&r2=563617
> ==============================================================================
> --- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java (original)
> +++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java Tue Aug  7 11:41:21 2007
> @@ -43,11 +43,11 @@
>  import org.apache.ivy.core.module.id.ArtifactId;
>  import org.apache.ivy.core.module.id.ModuleId;
>  import org.apache.ivy.core.module.id.ModuleRevisionId;
> -import org.apache.ivy.core.settings.IvySettings;
>  import org.apache.ivy.plugins.matcher.ExactPatternMatcher;
>  import org.apache.ivy.plugins.matcher.PatternMatcher;
>  import org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser;
>  import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
> +import org.apache.ivy.plugins.parser.ParserSettings;
>  import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorWriter;
>  import org.apache.ivy.plugins.repository.Resource;
>  import org.apache.ivy.util.Message;
> @@ -383,7 +383,7 @@
>
>      }
>
> -    public ModuleDescriptor parseDescriptor(IvySettings settings, URL descriptorURL, Resource res,
> +    public ModuleDescriptor parseDescriptor(ParserSettings settings, URL descriptorURL, Resource res,
>              boolean validate) throws ParseException, IOException {
>          Parser parser = new Parser(this, res);
>          try {
>
> Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
> URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java?view=diff&rev=563617&r1=563616&r2=563617
> ==============================================================================
> --- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java (original)
> +++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java Tue Aug  7 11:41:21 2007
> @@ -48,13 +48,13 @@
>  import org.apache.ivy.core.module.id.ArtifactId;
>  import org.apache.ivy.core.module.id.ModuleId;
>  import org.apache.ivy.core.module.id.ModuleRevisionId;
> -import org.apache.ivy.core.settings.IvySettings;
>  import org.apache.ivy.plugins.conflict.ConflictManager;
>  import org.apache.ivy.plugins.conflict.FixedConflictManager;
>  import org.apache.ivy.plugins.matcher.PatternMatcher;
>  import org.apache.ivy.plugins.namespace.Namespace;
>  import org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser;
>  import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
> +import org.apache.ivy.plugins.parser.ParserSettings;
>  import org.apache.ivy.plugins.repository.Resource;
>  import org.apache.ivy.plugins.repository.url.URLResource;
>  import org.apache.ivy.util.Message;
> @@ -92,7 +92,7 @@
>       * @throws ParseException
>       * @throws IOException
>       */
> -    public ModuleDescriptor parseDescriptor(IvySettings ivySettings, URL xmlURL, Resource res,
> +    public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL xmlURL, Resource res,
>              boolean validate) throws ParseException, IOException {
>          Parser parser = new Parser(this, ivySettings, validate, xmlURL);
>          parser.parse(res, validate);
> @@ -100,7 +100,7 @@
>      }
>
>      /** Used for test purpose */
> -    ModuleDescriptor parseDescriptor(IvySettings ivySettings, InputStream descriptor,
> +    ModuleDescriptor parseDescriptor(ParserSettings ivySettings, InputStream descriptor,
>              Resource res, boolean validate) throws ParseException, IOException {
>          Parser parser = new Parser(this, ivySettings, validate, null);
>          parser.parse(descriptor, res, validate);
> @@ -149,7 +149,7 @@
>
>          private boolean validate = true;
>
> -        private IvySettings ivy;
> +        private ParserSettings ivy;
>
>          private boolean artifactsDeclared = false;
>
> @@ -181,7 +181,7 @@
>
>          private final URL xmlURL;
>
> -        public Parser(ModuleDescriptorParser parser, IvySettings ivySettings, boolean validate,
> +        public Parser(ModuleDescriptorParser parser, ParserSettings ivySettings, boolean validate,
>                  URL xmlURL) {
>              super(parser);
>              ivy = ivySettings;
>
> Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
> URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java?view=diff&rev=563617&r1=563616&r2=563617
> ==============================================================================
> --- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java (original)
> +++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java Tue Aug  7 11:41:21 2007
> @@ -45,6 +45,7 @@
>  import org.apache.ivy.core.module.id.ModuleRevisionId;
>  import org.apache.ivy.core.settings.IvySettings;
>  import org.apache.ivy.plugins.namespace.Namespace;
> +import org.apache.ivy.plugins.parser.ParserSettings;
>  import org.apache.ivy.plugins.repository.Resource;
>  import org.apache.ivy.plugins.repository.file.FileResource;
>  import org.apache.ivy.plugins.repository.url.URLResource;
> @@ -93,7 +94,7 @@
>              confsToExclude);
>      }
>
> -    public static void update(final IvySettings settings, URL srcURL, File destFile,
> +    public static void update(final ParserSettings settings, URL srcURL, File destFile,
>              final Map resolvedRevisions, final String status, final String revision,
>              final Date pubdate, final Namespace ns, final boolean replaceInclude,
>              String[] confsToExclude) throws IOException, SAXException {
> @@ -113,7 +114,7 @@
>          }
>      }
>
> -    public static void update(final IvySettings settings, URL srcURL, OutputStream destFile,
> +    public static void update(final ParserSettings settings, URL srcURL, OutputStream destFile,
>              final Map resolvedRevisions, final String status, final String revision,
>              final Date pubdate, final Namespace ns, final boolean replaceInclude,
>              String[] confsToExclude) throws IOException, SAXException {
> @@ -172,7 +173,7 @@
>
>      private static class UpdaterHandler extends DefaultHandler implements LexicalHandler {
>
> -        private final IvySettings settings;
> +        private final ParserSettings settings;
>
>          private final PrintWriter out;
>
> @@ -194,7 +195,7 @@
>
>          private final URL relativePathCtx;
>
> -        public UpdaterHandler(final IvySettings settings, final PrintWriter out,
> +        public UpdaterHandler(final ParserSettings settings, final PrintWriter out,
>                  final Map resolvedRevisions, final String status, final String revision,
>                  final Date pubdate, final Namespace ns, final boolean replaceInclude,
>                  final String[] confs, final URL relativePathCtx) {
> @@ -559,7 +560,7 @@
>              return buf.toString();
>          }
>
> -        private String substitute(IvySettings ivy, String value) {
> +        private String substitute(ParserSettings ivy, String value) {
>              return ivy == null ? value : ivy.substitute(value);
>          }
>
> @@ -697,7 +698,7 @@
>
>      }
>
> -    public static void update(final IvySettings settings, URL inStreamCtx, InputStream inStream,
> +    public static void update(final ParserSettings settings, URL inStreamCtx, InputStream inStream,
>              OutputStream outStream, final Map resolvedRevisions, final String status,
>              final String revision, final Date pubdate, final Namespace ns,
>              final boolean replaceInclude, String[] confsToExclude)
>
> Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistryTest.java
> URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistryTest.java?view=diff&rev=563617&r1=563616&r2=563617
> ==============================================================================
> --- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistryTest.java (original)
> +++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistryTest.java Tue Aug  7 11:41:21 2007
> @@ -33,7 +33,7 @@
>
>  public class ModuleDescriptorParserRegistryTest extends TestCase {
>      public static class MyParser extends AbstractModuleDescriptorParser {
> -        public ModuleDescriptor parseDescriptor(IvySettings ivy, URL descriptorURL, Resource res,
> +        public ModuleDescriptor parseDescriptor(ParserSettings ivy, URL descriptorURL, Resource res,
>                  boolean validate) throws ParseException, IOException {
>              return DefaultModuleDescriptor.newDefaultInstance(ModuleRevisionId.newInstance("test",
>                  "parser", "1.0"));
>
>
>


-- 
Gilles SCOKART

Re: svn commit: r563617 - in /incubator/ivy/core/trunk: src/java/org/apache/ivy/core/deliver/ src/java/org/apache/ivy/core/publish/ src/java/org/apache/ivy/core/settings/ src/java/org/apache/ivy/plugins/parser/ src/java/org/apache/ivy/plugins/parser/

Posted by Xavier Hanin <xa...@gmail.com>.
On 8/8/07, Gilles Scokart <gs...@gmail.com> wrote:
>
> This is the second commit in this direction (previous was done +/- 1
> month ago if I remember well).  My goal was to reduce the dependencies
> between the engine and the settings.  A side effect is that those
> dependencies are now much more visible (so much easier to isolate and
> refactor).
>
> A thing I didn't expected was the amount of settings required by the
> Parser (and currently passed via engine specific settings).
>
> I will continue with the other engines.
>
> The next step might be to:
> - Replace reference engines->Ivy class by reference engine->required
> engines (injected by the Ivy class).
> - Consider the parser as an Engine (= injecting a ParserEngine into
> the engines that requires parsing so that the Engine won't have
> anymore a dependency on the ParserSettings).
>
> WDYT?


I like this kind of refactoring, it makes things cleaner and clearer. About
the parser engine, I'm not sure about what I think, I'd need to check the
code with more care, which I don't have time to do right now.

Xavier

Gilles
>
>
> 2007/8/7, gscokart@apache.org <gs...@apache.org>:
> > Author: gscokart
> > Date: Tue Aug  7 11:41:21 2007
> > New Revision: 563617
> >
> > URL: http://svn.apache.org/viewvc?view=rev&rev=563617
> > Log:
> > refactor to isolate settings specific to deliverEngine and PublishEngine
> (like in SortEngine)
> >
> > Added:
> >
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngineSettings.java
> (with props)
> >
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngineSettings.java
> (with props)
> >
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java
> (with props)
> > Modified:
> >
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java
> >
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngine.java
> >
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
> >
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
> >
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java
> >
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java
> >
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
> >
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
> >
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
> >
> incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistryTest.java
> >
> > Modified:
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java
> > URL:
> http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java?view=diff&rev=563617&r1=563616&r2=563617
> >
> ==============================================================================
> > ---
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java
> (original)
> > +++
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java
> Tue Aug  7 11:41:21 2007
> > @@ -35,7 +35,6 @@
> >  import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
> >  import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
> >  import org.apache.ivy.core.module.id.ModuleRevisionId;
> > -import org.apache.ivy.core.settings.IvySettings;
> >  import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser;
> >  import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorUpdater;
> >  import org.apache.ivy.plugins.report.XmlReportParser;
> > @@ -44,9 +43,9 @@
> >  import org.xml.sax.SAXException;
> >
> >  public class DeliverEngine {
> > -    private IvySettings settings;
> > +    private DeliverEngineSettings settings;
> >
> > -    public DeliverEngine(IvySettings settings) {
> > +    public DeliverEngine(DeliverEngineSettings settings) {
> >          this.settings = settings;
> >      }
> >
> >
> > Added:
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngineSettings.java
> > URL:
> http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngineSettings.java?view=auto&rev=563617
> >
> ==============================================================================
> > ---
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngineSettings.java
> (added)
> > +++
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngineSettings.java
> Tue Aug  7 11:41:21 2007
> > @@ -0,0 +1,26 @@
> > +/*
> > + *  Licensed to the Apache Software Foundation (ASF) under one or more
> > + *  contributor license agreements.  See the NOTICE file distributed
> with
> > + *  this work for additional information regarding copyright ownership.
> > + *  The ASF licenses this file to You under the Apache License, Version
> 2.0
> > + *  (the "License"); you may not use this file except in compliance
> with
> > + *  the License.  You may obtain a copy of the License at
> > + *
> > + *      http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + *  Unless required by applicable law or agreed to in writing, software
> > + *  distributed under the License is distributed on an "AS IS" BASIS,
> > + *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> > + *  See the License for the specific language governing permissions and
> > + *  limitations under the License.
> > + *
> > + */
> > +package org.apache.ivy.core.deliver;
> > +
> > +import org.apache.ivy.plugins.parser.ParserSettings;
> > +
> > +public interface DeliverEngineSettings extends ParserSettings {
> > +
> > +    String substitute(String destIvyPattern);
> > +
> > +}
> >
> > Propchange:
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngineSettings.java
> >
> ------------------------------------------------------------------------------
> >     svn:eol-style = native
> >
> > Modified:
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngine.java
> > URL:
> http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngine.java?view=diff&rev=563617&r1=563616&r2=563617
> >
> ==============================================================================
> > ---
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngine.java
> (original)
> > +++
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngine.java
> Tue Aug  7 11:41:21 2007
> > @@ -39,7 +39,6 @@
> >  import org.apache.ivy.core.module.descriptor.MDArtifact;
> >  import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
> >  import org.apache.ivy.core.module.id.ModuleRevisionId;
> > -import org.apache.ivy.core.settings.IvySettings;
> >  import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser;
> >  import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorUpdater;
> >  import org.apache.ivy.plugins.resolver.DependencyResolver;
> > @@ -48,9 +47,9 @@
> >  import org.xml.sax.SAXException;
> >
> >  public class PublishEngine {
> > -    private IvySettings settings;
> > +    private PublishEngineSettings settings;
> >
> > -    public PublishEngine(IvySettings settings) {
> > +    public PublishEngine(PublishEngineSettings settings) {
> >          this.settings = settings;
> >      }
> >
> >
> > Added:
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngineSettings.java
> > URL:
> http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngineSettings.java?view=auto&rev=563617
> >
> ==============================================================================
> > ---
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngineSettings.java
> (added)
> > +++
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngineSettings.java
> Tue Aug  7 11:41:21 2007
> > @@ -0,0 +1,32 @@
> > +/*
> > + *  Licensed to the Apache Software Foundation (ASF) under one or more
> > + *  contributor license agreements.  See the NOTICE file distributed
> with
> > + *  this work for additional information regarding copyright ownership.
> > + *  The ASF licenses this file to You under the Apache License, Version
> 2.0
> > + *  (the "License"); you may not use this file except in compliance
> with
> > + *  the License.  You may obtain a copy of the License at
> > + *
> > + *      http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + *  Unless required by applicable law or agreed to in writing, software
> > + *  distributed under the License is distributed on an "AS IS" BASIS,
> > + *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> > + *  See the License for the specific language governing permissions and
> > + *  limitations under the License.
> > + *
> > + */
> > +package org.apache.ivy.core.publish;
> > +
> > +import org.apache.ivy.plugins.parser.ParserSettings;
> > +import org.apache.ivy.plugins.resolver.DependencyResolver;
> > +
> > +/**
> > + * Settings specific to the publish engine
> > + */
> > +public interface PublishEngineSettings extends ParserSettings {
> > +
> > +    String substitute(String srcIvyPattern);
> > +
> > +    DependencyResolver getResolver(String resolverName);
> > +
> > +}
> >
> > Propchange:
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/publish/PublishEngineSettings.java
> >
> ------------------------------------------------------------------------------
> >     svn:eol-style = native
> >
> > Modified:
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
> > URL:
> http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java?view=diff&rev=563617&r1=563616&r2=563617
> >
> ==============================================================================
> > ---
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
> (original)
> > +++
> incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
> Tue Aug  7 11:41:21 2007
> > @@ -40,8 +40,10 @@
> >  import org.apache.ivy.core.IvyPatternHelper;
> >  import org.apache.ivy.core.NormalRelativeUrlResolver;
> >  import org.apache.ivy.core.RelativeUrlResolver;
> > +import org.apache.ivy.core.deliver.DeliverEngineSettings;
> >  import org.apache.ivy.core.module.id.ModuleId;
> >  import org.apache.ivy.core.module.status.StatusManager;
> > +import org.apache.ivy.core.publish.PublishEngineSettings;
> >  import org.apache.ivy.core.sort.SortEngineSettings;
> >  import org.apache.ivy.plugins.IvyAware;
> >  import org.apache.ivy.plugins.IvySettingsAware;
> > @@ -65,6 +67,7 @@
> >  import org.apache.ivy.plugins.namespace.Namespace;
> >  import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
> >  import org.apache.ivy.plugins.parser.ModuleDescriptorParserRegistry;
> > +import org.apache.ivy.plugins.parser.ParserSettings;
> >  import org.apache.ivy.plugins.report.LogReportOutputter;
> >  import org.apache.ivy.plugins.report.ReportOutputter;
> >  import org.apache.ivy.plugins.report.XmlReportOutputter;
> > @@ -81,7 +84,7 @@
> >  import org.apache.ivy.util.Message;
> >  import org.apache.ivy.util.url.URLHandlerRegistry;
> >
> > -public class IvySettings implements SortEngineSettings {
> > +public class IvySettings implements SortEngineSettings ,
> PublishEngineSettings , ParserSettings , DeliverEngineSettings {
> >      private static final String DEFAULT_CACHE_ARTIFACT_PATTERN =
>
> >          "[organisation]/[module]/[type]s/[artifact]-[revision](.[ext])";
> >
> >
> > Modified:
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
> > URL:
> http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java?view=diff&rev=563617&r1=563616&r2=563617
> >
> ==============================================================================
> > ---
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
> (original)
> > +++
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
> Tue Aug  7 11:41:21 2007
> > @@ -32,7 +32,6 @@
> >  import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
> >  import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
> >  import org.apache.ivy.core.module.id.ModuleRevisionId;
> > -import org.apache.ivy.core.settings.IvySettings;
> >  import org.apache.ivy.plugins.repository.Resource;
> >  import org.apache.ivy.plugins.repository.url.URLResource;
> >  import org.apache.ivy.util.Message;
> > @@ -41,7 +40,7 @@
> >  import org.xml.sax.helpers.DefaultHandler;
> >
> >  public abstract class AbstractModuleDescriptorParser implements
> ModuleDescriptorParser {
> > -    public ModuleDescriptor parseDescriptor(IvySettings ivySettings,
> URL descriptorURL,
> > +    public ModuleDescriptor parseDescriptor(ParserSettings ivySettings,
> URL descriptorURL,
> >              boolean validate) throws ParseException, IOException {
> >          return parseDescriptor(ivySettings, descriptorURL,
> >              new URLResource(descriptorURL), validate);
> >
> > Modified:
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java
> > URL:
> http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java?view=diff&rev=563617&r1=563616&r2=563617
> >
> ==============================================================================
> > ---
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java
> (original)
> > +++
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java
> Tue Aug  7 11:41:21 2007
> > @@ -24,14 +24,13 @@
> >  import java.text.ParseException;
> >
> >  import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
> > -import org.apache.ivy.core.settings.IvySettings;
> >  import org.apache.ivy.plugins.repository.Resource;
> >
> >  public interface ModuleDescriptorParser {
> > -    public ModuleDescriptor parseDescriptor(IvySettings ivySettings,
> URL descriptorURL,
> > +    public ModuleDescriptor parseDescriptor(ParserSettings ivySettings,
> URL descriptorURL,
> >              boolean validate) throws ParseException, IOException;
> >
> > -    public ModuleDescriptor parseDescriptor(IvySettings ivySettings,
> URL descriptorURL,
> > +    public ModuleDescriptor parseDescriptor(ParserSettings ivySettings,
> URL descriptorURL,
> >              Resource res, boolean validate) throws ParseException,
> IOException;
> >
> >      /**
> >
> > Modified:
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java
> > URL:
> http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java?view=diff&rev=563617&r1=563616&r2=563617
> >
> ==============================================================================
> > ---
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java
> (original)
> > +++
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java
> Tue Aug  7 11:41:21 2007
> > @@ -27,7 +27,6 @@
> >  import java.util.List;
> >
> >  import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
> > -import org.apache.ivy.core.settings.IvySettings;
> >  import org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser;
> >  import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser;
> >  import org.apache.ivy.plugins.repository.Resource;
> > @@ -76,7 +75,7 @@
> >          return null;
> >      }
> >
> > -    public ModuleDescriptor parseDescriptor(IvySettings settings, URL
> descriptorURL, Resource res,
> > +    public ModuleDescriptor parseDescriptor(ParserSettings settings,
> URL descriptorURL, Resource res,
> >              boolean validate) throws ParseException, IOException {
> >          ModuleDescriptorParser parser = getParser(res);
> >          if (parser == null) {
> >
> > Added:
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java
> > URL:
> http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java?view=auto&rev=563617
> >
> ==============================================================================
> > ---
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java
> (added)
> > +++
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java
> Tue Aug  7 11:41:21 2007
> > @@ -0,0 +1,40 @@
> > +/*
> > + *  Licensed to the Apache Software Foundation (ASF) under one or more
> > + *  contributor license agreements.  See the NOTICE file distributed
> with
> > + *  this work for additional information regarding copyright ownership.
> > + *  The ASF licenses this file to You under the Apache License, Version
> 2.0
> > + *  (the "License"); you may not use this file except in compliance
> with
> > + *  the License.  You may obtain a copy of the License at
> > + *
> > + *      http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + *  Unless required by applicable law or agreed to in writing, software
> > + *  distributed under the License is distributed on an "AS IS" BASIS,
> > + *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> > + *  See the License for the specific language governing permissions and
> > + *  limitations under the License.
> > + *
> > + */
> > +package org.apache.ivy.plugins.parser;
> > +
> > +import org.apache.ivy.core.RelativeUrlResolver;
> > +import org.apache.ivy.core.module.status.StatusManager;
> > +import org.apache.ivy.plugins.conflict.ConflictManager;
> > +import org.apache.ivy.plugins.matcher.PatternMatcher;
> > +import org.apache.ivy.plugins.namespace.Namespace;
> > +
> > +public interface ParserSettings {
> > +
> > +    String substitute(String value);
> > +
> > +    ConflictManager getConflictManager(String name);
> > +
> > +    PatternMatcher getMatcher(String matcherName);
> > +
> > +    Namespace getNamespace(String namespace);
> > +
> > +    StatusManager getStatusManager();
> > +
> > +    RelativeUrlResolver getRelativeUrlResolver();
> > +
> > +}
> >
> > Propchange:
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java
> >
> ------------------------------------------------------------------------------
> >     svn:eol-style = native
> >
> > Modified:
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
> > URL:
> http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?view=diff&rev=563617&r1=563616&r2=563617
> >
> ==============================================================================
> > ---
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
> (original)
> > +++
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
> Tue Aug  7 11:41:21 2007
> > @@ -43,11 +43,11 @@
> >  import org.apache.ivy.core.module.id.ArtifactId;
> >  import org.apache.ivy.core.module.id.ModuleId;
> >  import org.apache.ivy.core.module.id.ModuleRevisionId;
> > -import org.apache.ivy.core.settings.IvySettings;
> >  import org.apache.ivy.plugins.matcher.ExactPatternMatcher;
> >  import org.apache.ivy.plugins.matcher.PatternMatcher;
> >  import org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser;
> >  import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
> > +import org.apache.ivy.plugins.parser.ParserSettings;
> >  import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorWriter;
> >  import org.apache.ivy.plugins.repository.Resource;
> >  import org.apache.ivy.util.Message;
> > @@ -383,7 +383,7 @@
> >
> >      }
> >
> > -    public ModuleDescriptor parseDescriptor(IvySettings settings, URL
> descriptorURL, Resource res,
> > +    public ModuleDescriptor parseDescriptor(ParserSettings settings,
> URL descriptorURL, Resource res,
> >              boolean validate) throws ParseException, IOException {
> >          Parser parser = new Parser(this, res);
> >          try {
> >
> > Modified:
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
> > URL:
> http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java?view=diff&rev=563617&r1=563616&r2=563617
> >
> ==============================================================================
> > ---
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
> (original)
> > +++
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
> Tue Aug  7 11:41:21 2007
> > @@ -48,13 +48,13 @@
> >  import org.apache.ivy.core.module.id.ArtifactId;
> >  import org.apache.ivy.core.module.id.ModuleId;
> >  import org.apache.ivy.core.module.id.ModuleRevisionId;
> > -import org.apache.ivy.core.settings.IvySettings;
> >  import org.apache.ivy.plugins.conflict.ConflictManager;
> >  import org.apache.ivy.plugins.conflict.FixedConflictManager;
> >  import org.apache.ivy.plugins.matcher.PatternMatcher;
> >  import org.apache.ivy.plugins.namespace.Namespace;
> >  import org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser;
> >  import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
> > +import org.apache.ivy.plugins.parser.ParserSettings;
> >  import org.apache.ivy.plugins.repository.Resource;
> >  import org.apache.ivy.plugins.repository.url.URLResource;
> >  import org.apache.ivy.util.Message;
> > @@ -92,7 +92,7 @@
> >       * @throws ParseException
> >       * @throws IOException
> >       */
> > -    public ModuleDescriptor parseDescriptor(IvySettings ivySettings,
> URL xmlURL, Resource res,
> > +    public ModuleDescriptor parseDescriptor(ParserSettings ivySettings,
> URL xmlURL, Resource res,
> >              boolean validate) throws ParseException, IOException {
> >          Parser parser = new Parser(this, ivySettings, validate,
> xmlURL);
> >          parser.parse(res, validate);
> > @@ -100,7 +100,7 @@
> >      }
> >
> >      /** Used for test purpose */
> > -    ModuleDescriptor parseDescriptor(IvySettings ivySettings,
> InputStream descriptor,
> > +    ModuleDescriptor parseDescriptor(ParserSettings ivySettings,
> InputStream descriptor,
> >              Resource res, boolean validate) throws ParseException,
> IOException {
> >          Parser parser = new Parser(this, ivySettings, validate, null);
> >          parser.parse(descriptor, res, validate);
> > @@ -149,7 +149,7 @@
> >
> >          private boolean validate = true;
> >
> > -        private IvySettings ivy;
> > +        private ParserSettings ivy;
> >
> >          private boolean artifactsDeclared = false;
> >
> > @@ -181,7 +181,7 @@
> >
> >          private final URL xmlURL;
> >
> > -        public Parser(ModuleDescriptorParser parser, IvySettings
> ivySettings, boolean validate,
> > +        public Parser(ModuleDescriptorParser parser, ParserSettings
> ivySettings, boolean validate,
> >                  URL xmlURL) {
> >              super(parser);
> >              ivy = ivySettings;
> >
> > Modified:
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
> > URL:
> http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java?view=diff&rev=563617&r1=563616&r2=563617
> >
> ==============================================================================
> > ---
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
> (original)
> > +++
> incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
> Tue Aug  7 11:41:21 2007
> > @@ -45,6 +45,7 @@
> >  import org.apache.ivy.core.module.id.ModuleRevisionId;
> >  import org.apache.ivy.core.settings.IvySettings;
> >  import org.apache.ivy.plugins.namespace.Namespace;
> > +import org.apache.ivy.plugins.parser.ParserSettings;
> >  import org.apache.ivy.plugins.repository.Resource;
> >  import org.apache.ivy.plugins.repository.file.FileResource;
> >  import org.apache.ivy.plugins.repository.url.URLResource;
> > @@ -93,7 +94,7 @@
> >              confsToExclude);
> >      }
> >
> > -    public static void update(final IvySettings settings, URL srcURL,
> File destFile,
> > +    public static void update(final ParserSettings settings, URL
> srcURL, File destFile,
> >              final Map resolvedRevisions, final String status, final
> String revision,
> >              final Date pubdate, final Namespace ns, final boolean
> replaceInclude,
> >              String[] confsToExclude) throws IOException, SAXException {
> > @@ -113,7 +114,7 @@
> >          }
> >      }
> >
> > -    public static void update(final IvySettings settings, URL srcURL,
> OutputStream destFile,
> > +    public static void update(final ParserSettings settings, URL
> srcURL, OutputStream destFile,
> >              final Map resolvedRevisions, final String status, final
> String revision,
> >              final Date pubdate, final Namespace ns, final boolean
> replaceInclude,
> >              String[] confsToExclude) throws IOException, SAXException {
> > @@ -172,7 +173,7 @@
> >
> >      private static class UpdaterHandler extends DefaultHandler
> implements LexicalHandler {
> >
> > -        private final IvySettings settings;
> > +        private final ParserSettings settings;
> >
> >          private final PrintWriter out;
> >
> > @@ -194,7 +195,7 @@
> >
> >          private final URL relativePathCtx;
> >
> > -        public UpdaterHandler(final IvySettings settings, final
> PrintWriter out,
> > +        public UpdaterHandler(final ParserSettings settings, final
> PrintWriter out,
> >                  final Map resolvedRevisions, final String status, final
> String revision,
> >                  final Date pubdate, final Namespace ns, final boolean
> replaceInclude,
> >                  final String[] confs, final URL relativePathCtx) {
> > @@ -559,7 +560,7 @@
> >              return buf.toString();
> >          }
> >
> > -        private String substitute(IvySettings ivy, String value) {
> > +        private String substitute(ParserSettings ivy, String value) {
> >              return ivy == null ? value : ivy.substitute(value);
> >          }
> >
> > @@ -697,7 +698,7 @@
> >
> >      }
> >
> > -    public static void update(final IvySettings settings, URL
> inStreamCtx, InputStream inStream,
> > +    public static void update(final ParserSettings settings, URL
> inStreamCtx, InputStream inStream,
> >              OutputStream outStream, final Map resolvedRevisions, final
> String status,
> >              final String revision, final Date pubdate, final Namespace
> ns,
> >              final boolean replaceInclude, String[] confsToExclude)
> >
> > Modified:
> incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistryTest.java
> > URL:
> http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistryTest.java?view=diff&rev=563617&r1=563616&r2=563617
> >
> ==============================================================================
> > ---
> incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistryTest.java
> (original)
> > +++
> incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistryTest.java
> Tue Aug  7 11:41:21 2007
> > @@ -33,7 +33,7 @@
> >
> >  public class ModuleDescriptorParserRegistryTest extends TestCase {
> >      public static class MyParser extends AbstractModuleDescriptorParser
> {
> > -        public ModuleDescriptor parseDescriptor(IvySettings ivy, URL
> descriptorURL, Resource res,
> > +        public ModuleDescriptor parseDescriptor(ParserSettings ivy, URL
> descriptorURL, Resource res,
> >                  boolean validate) throws ParseException, IOException {
> >              return DefaultModuleDescriptor.newDefaultInstance(
> ModuleRevisionId.newInstance("test",
> >                  "parser", "1.0"));
> >
> >
> >
>
>
> --
> Gilles SCOKART
>



-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://incubator.apache.org/ivy/
http://www.xoocode.org/