public class DoapUtil extends Object
DoapMojo
class.Modifier and Type | Class and Description |
---|---|
static class |
DoapUtil.Organization
Utility class for keeping track of DOAP organizations in the DoaP mojo.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_TIMEOUT
The default timeout used when fetching url, i.e.
|
protected static String |
RDF_NODE_ID
RDF nodeID attribute
|
protected static String |
RDF_RESOURCE
RDF resource attribute
|
Constructor and Description |
---|
DoapUtil() |
Modifier and Type | Method and Description |
---|---|
static DoapUtil.Organization |
addOrganization(String name,
String url)
put an organization from the pom file in the organization list.
|
static void |
fetchURL(org.apache.maven.settings.Settings settings,
URL url)
Fetch an URL
|
static List<org.apache.maven.model.Contributor> |
getContributorsWithDeveloperRole(org.codehaus.plexus.i18n.I18N i18n,
List<org.apache.maven.model.Contributor> developersOrContributors) |
static List<org.apache.maven.model.Contributor> |
getContributorsWithDocumenterRole(org.codehaus.plexus.i18n.I18N i18n,
List<org.apache.maven.model.Contributor> developersOrContributors) |
static List<org.apache.maven.model.Contributor> |
getContributorsWithHelperRole(org.codehaus.plexus.i18n.I18N i18n,
List<org.apache.maven.model.Contributor> developersOrContributors) |
static List<org.apache.maven.model.Contributor> |
getContributorsWithMaintainerRole(org.codehaus.plexus.i18n.I18N i18n,
List<org.apache.maven.model.Contributor> developersOrContributors) |
static List<org.apache.maven.model.Contributor> |
getContributorsWithTesterRole(org.codehaus.plexus.i18n.I18N i18n,
List<org.apache.maven.model.Contributor> developersOrContributors) |
static List<org.apache.maven.model.Contributor> |
getContributorsWithTranslatorRole(org.codehaus.plexus.i18n.I18N i18n,
List<org.apache.maven.model.Contributor> developersOrContributors) |
static List<org.apache.maven.model.Contributor> |
getContributorsWithUnknownRole(org.codehaus.plexus.i18n.I18N i18n,
List<org.apache.maven.model.Contributor> developersOrContributors) |
static String |
getNodeId()
get a unique (within the DoaP file) RDF blank node ID
|
static Set<Map.Entry<String,DoapUtil.Organization>> |
getOrganizations()
get the set of Organizations that people are members of
|
static String |
interpolate(String value,
org.apache.maven.project.MavenProject project,
org.apache.maven.settings.Settings settings)
Interpolate a string with project and settings.
|
static boolean |
isValidEmail(String str) |
static List<String> |
validate(File doapFile)
Validate the given DOAP file.
|
static void |
writeComment(org.codehaus.plexus.util.xml.XMLWriter writer,
String comment)
Write comment.
|
static void |
writeElement(org.codehaus.plexus.util.xml.XMLWriter writer,
String xmlnsPrefix,
String name,
String value) |
static void |
writeElement(org.codehaus.plexus.util.xml.XMLWriter writer,
String xmlnsPrefix,
String name,
String value,
String lang) |
static void |
writeHeader(org.codehaus.plexus.util.xml.XMLWriter writer)
Write comments in the DOAP file header
|
static void |
writeRdfNodeIdElement(org.codehaus.plexus.util.xml.XMLWriter writer,
String xmlnsPrefix,
String name,
String value) |
static void |
writeRdfResourceElement(org.codehaus.plexus.util.xml.XMLWriter writer,
String xmlnsPrefix,
String name,
String value) |
static void |
writeStartElement(org.codehaus.plexus.util.xml.XMLWriter writer,
String xmlnsPrefix,
String name) |
public static final int DEFAULT_TIMEOUT
protected static final String RDF_RESOURCE
protected static final String RDF_NODE_ID
public static void writeHeader(org.codehaus.plexus.util.xml.XMLWriter writer)
writer
- not nullpublic static void writeComment(org.codehaus.plexus.util.xml.XMLWriter writer, String comment) throws IllegalArgumentException
writer
- not nullcomment
- not nullIllegalArgumentException
- if comment is null or emptypublic static void writeElement(org.codehaus.plexus.util.xml.XMLWriter writer, String xmlnsPrefix, String name, String value) throws IllegalArgumentException
writer
- not nullxmlnsPrefix
- could be nullname
- not nullvalue
- could be null. In this case, the element is not written.IllegalArgumentException
- if name is null or emptypublic static void writeElement(org.codehaus.plexus.util.xml.XMLWriter writer, String xmlnsPrefix, String name, String value, String lang) throws IllegalArgumentException
writer
- not nullxmlnsPrefix
- could be nullname
- not nulllang
- not nullvalue
- could be null. In this case, the element is not written.IllegalArgumentException
- if name is null or emptypublic static void writeStartElement(org.codehaus.plexus.util.xml.XMLWriter writer, String xmlnsPrefix, String name) throws IllegalArgumentException
writer
- not nullxmlnsPrefix
- could be nullname
- not nullIllegalArgumentException
- if name is null or emptypublic static void writeRdfResourceElement(org.codehaus.plexus.util.xml.XMLWriter writer, String xmlnsPrefix, String name, String value) throws IllegalArgumentException
writer
- not nullxmlnsPrefix
- could be nullname
- not nullvalue
- could be null. In this case, the element is not written.IllegalArgumentException
- if name is null or emptypublic static void writeRdfNodeIdElement(org.codehaus.plexus.util.xml.XMLWriter writer, String xmlnsPrefix, String name, String value) throws IllegalArgumentException
writer
- not nullname
- not nullvalue
- could be null. In this case, the element is not written.IllegalArgumentException
- if name is null or emptypublic static List<org.apache.maven.model.Contributor> getContributorsWithDeveloperRole(org.codehaus.plexus.i18n.I18N i18n, List<org.apache.maven.model.Contributor> developersOrContributors)
i18n
- the internationalization componentdevelopersOrContributors
- list of Contributor
Contributor
which have a developer
DOAP role.public static List<org.apache.maven.model.Contributor> getContributorsWithDocumenterRole(org.codehaus.plexus.i18n.I18N i18n, List<org.apache.maven.model.Contributor> developersOrContributors)
i18n
- the internationalization componentdevelopersOrContributors
- list of Contributor
Contributor
which have a documenter
DOAP role.public static List<org.apache.maven.model.Contributor> getContributorsWithHelperRole(org.codehaus.plexus.i18n.I18N i18n, List<org.apache.maven.model.Contributor> developersOrContributors)
i18n
- the internationalization componentdevelopersOrContributors
- list of Contributor
Contributor
which have an helper
DOAP role.public static List<org.apache.maven.model.Contributor> getContributorsWithMaintainerRole(org.codehaus.plexus.i18n.I18N i18n, List<org.apache.maven.model.Contributor> developersOrContributors)
i18n
- the internationalization componentdevelopersOrContributors
- list of Contributor
Contributor
which have a maintainer
DOAP role.public static List<org.apache.maven.model.Contributor> getContributorsWithTesterRole(org.codehaus.plexus.i18n.I18N i18n, List<org.apache.maven.model.Contributor> developersOrContributors)
i18n
- the internationalization componentdevelopersOrContributors
- list of Contributor
Contributor
which have a tester
DOAP role.public static List<org.apache.maven.model.Contributor> getContributorsWithTranslatorRole(org.codehaus.plexus.i18n.I18N i18n, List<org.apache.maven.model.Contributor> developersOrContributors)
i18n
- the internationalization componentdevelopersOrContributors
- list of Contributor
Contributor
which have a translator
DOAP role.public static List<org.apache.maven.model.Contributor> getContributorsWithUnknownRole(org.codehaus.plexus.i18n.I18N i18n, List<org.apache.maven.model.Contributor> developersOrContributors)
i18n
- the internationalization componentdevelopersOrContributors
- list of Contributor
Contributor
which have an unknown
DOAP role.public static DoapUtil.Organization addOrganization(String name, String url)
name
- from the pom file (e.g. Yoyodyne)url
- from the pom file (e.g. http://yoyodyne.example.org/about)public static String getNodeId()
public static Set<Map.Entry<String,DoapUtil.Organization>> getOrganizations()
public static List<String> validate(File doapFile)
doapFile
- not null and should exists.public static boolean isValidEmail(String str)
str
- not nulltrue
if the str parameter is a valid email, false
otherwise.public static void fetchURL(org.apache.maven.settings.Settings settings, URL url) throws IOException
settings
- the user settings used to fetch the url with an active proxy, if defined.url
- the url to fetchIOException
- if anyDEFAULT_TIMEOUT
public static String interpolate(String value, org.apache.maven.project.MavenProject project, org.apache.maven.settings.Settings settings)
value
- could be nullproject
- not nullsettings
- could be nullCopyright © 2002–2015 The Apache Software Foundation. All rights reserved.