Class ArchetypeDescriptorBuilder
java.lang.Object
org.apache.maven.archetype.old.descriptor.ArchetypeDescriptorBuilder
- Version:
- $Id$
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addResourceToDescriptor
(org.codehaus.plexus.util.xml.Xpp3Dom resource, ArchetypeDescriptor descriptor) Adds the resource elementresource
to the list of resources in thedescriptor
and sets itsTemplateDescriptor
to filtered if the attributefiltered
was not specified or its value is"true"
, orfalse
if its value is"false"
, and the encoding specified in theencoding
attribute or the Java virtual machine's default if it is not defined.private static void
addSiteResourceToDescriptor
(org.codehaus.plexus.util.xml.Xpp3Dom siteResource, ArchetypeDescriptor descriptor) Adds the site-resource elementresource
to the list of site-resources in thedescriptor
and sets itsTemplateDescriptor
to filtered if the attributefiltered
was not specified or its value is"true"
, orfalse
if its value is"false"
, and the encoding specified in theencoding
attribute or the Java virtual machine's default if it is not defined.private static void
addSourceToDescriptor
(org.codehaus.plexus.util.xml.Xpp3Dom source, ArchetypeDescriptor descriptor) Adds the source elementsource
to the list of sources in thedescriptor
and sets itsTemplateDescriptor
to filtered and with the encoding specified in theencoding
attribute or the Java virtual machine's default if it is not defined.private static void
addTestResourceToDescriptor
(org.codehaus.plexus.util.xml.Xpp3Dom testResource, ArchetypeDescriptor descriptor) Adds the test-resource elementresource
to the list of test-resources in thedescriptor
and sets itsTemplateDescriptor
to filtered if the attributefiltered
was not specified or its value is"true"
, orfalse
if its value is"false"
, and the encoding specified in theencoding
attribute or the Java virtual machine's default if it is not defined.private static void
addTestSourceToDescriptor
(org.codehaus.plexus.util.xml.Xpp3Dom testSource, ArchetypeDescriptor descriptor) Adds the test-source elementsource
to the list of sources in thedescriptor
and sets itsTemplateDescriptor
to filtered and with the encoding specified in theencoding
attribute or the Java virtual machine's default if it is not defined.private static boolean
-
Constructor Details
-
ArchetypeDescriptorBuilder
public ArchetypeDescriptorBuilder()
-
-
Method Details
-
build
public ArchetypeDescriptor build(Reader reader) throws IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException - Throws:
IOException
org.codehaus.plexus.util.xml.pull.XmlPullParserException
-
addSourceToDescriptor
private static void addSourceToDescriptor(org.codehaus.plexus.util.xml.Xpp3Dom source, ArchetypeDescriptor descriptor) throws org.codehaus.plexus.util.xml.pull.XmlPullParserException Adds the source elementsource
to the list of sources in thedescriptor
and sets itsTemplateDescriptor
to filtered and with the encoding specified in theencoding
attribute or the Java virtual machine's default if it is not defined.- Parameters:
source
- a<source>
element from the<sources>
descriptor
- theArchetypeDescriptor
to add the source template to.- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException
- if the encoding specified is not valid or supported.
-
addResourceToDescriptor
private static void addResourceToDescriptor(org.codehaus.plexus.util.xml.Xpp3Dom resource, ArchetypeDescriptor descriptor) throws org.codehaus.plexus.util.xml.pull.XmlPullParserException Adds the resource elementresource
to the list of resources in thedescriptor
and sets itsTemplateDescriptor
to filtered if the attributefiltered
was not specified or its value is"true"
, orfalse
if its value is"false"
, and the encoding specified in theencoding
attribute or the Java virtual machine's default if it is not defined. If theresource
is a property file (ends in.properties
) its encoding will be set toiso-8859-1
even if some other encoding is specified in the attribute.- Parameters:
resource
- a<resource>
element from the<resources>
descriptor
- theArchetypeDescriptor
to add the resource template to.- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException
- if the encoding specified is not valid or supported or if the value of the attributefiltered
is no valid.
-
addTestSourceToDescriptor
private static void addTestSourceToDescriptor(org.codehaus.plexus.util.xml.Xpp3Dom testSource, ArchetypeDescriptor descriptor) throws org.codehaus.plexus.util.xml.pull.XmlPullParserException Adds the test-source elementsource
to the list of sources in thedescriptor
and sets itsTemplateDescriptor
to filtered and with the encoding specified in theencoding
attribute or the Java virtual machine's default if it is not defined.- Parameters:
testSource
- a<source>
element from the<testSources>
descriptor
- theArchetypeDescriptor
to add the test-source template to.- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException
- if the encoding specified is not valid or supported.
-
addTestResourceToDescriptor
private static void addTestResourceToDescriptor(org.codehaus.plexus.util.xml.Xpp3Dom testResource, ArchetypeDescriptor descriptor) throws org.codehaus.plexus.util.xml.pull.XmlPullParserException Adds the test-resource elementresource
to the list of test-resources in thedescriptor
and sets itsTemplateDescriptor
to filtered if the attributefiltered
was not specified or its value is"true"
, orfalse
if its value is"false"
, and the encoding specified in theencoding
attribute or the Java virtual machine's default if it is not defined. If theresource
is a property file (ends in.properties
) its encoding will be set toiso-8859-1
even if some other encoding is specified in the attribute.- Parameters:
testResource
- a<resource>
element from the<testResources>
descriptor
- theArchetypeDescriptor
to add the test-resource template to.- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException
- if the encoding specified is not valid or supported or if the value of the attributefiltered
is no valid.
-
addSiteResourceToDescriptor
private static void addSiteResourceToDescriptor(org.codehaus.plexus.util.xml.Xpp3Dom siteResource, ArchetypeDescriptor descriptor) throws org.codehaus.plexus.util.xml.pull.XmlPullParserException Adds the site-resource elementresource
to the list of site-resources in thedescriptor
and sets itsTemplateDescriptor
to filtered if the attributefiltered
was not specified or its value is"true"
, orfalse
if its value is"false"
, and the encoding specified in theencoding
attribute or the Java virtual machine's default if it is not defined. If theresource
is a property file (ends in.properties
) its encoding will be set toiso-8859-1
even if some other encoding is specified in the attribute.- Parameters:
siteResource
- a<resource>
element from the<siteResources>
descriptor
- theArchetypeDescriptor
to add the site-resource template to.- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException
- if the encoding specified is not valid or supported or if the value of the attributefiltered
is no valid.
-
getValueFilteredAttribute
- Throws:
IllegalArgumentException
-