Package org.apache.maven.plugin.doap
Class DoapUtil
java.lang.Object
org.apache.maven.plugin.doap.DoapUtil
Utility class for
DoapMojo class.- Since:
- 1.0
- Author:
- Vincent Siveton
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUtility class for keeping track of DOAP organizations in the DoaP mojo. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DoapUtil.OrganizationaddOrganization(String name, String url) Put an organization from the pom file in the organization list.static voidDeprecated.Use java.net.URL or a different library to load the 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 StringGet a unique (within the DoaP file) RDF blank node ID.static Set<Map.Entry<String, DoapUtil.Organization>> Get the set of Organizations that people are members of.static Stringinterpolate(String value, org.apache.maven.project.MavenProject project, org.apache.maven.settings.Settings settings) Interpolate a string with project and settings.static booleanisValidEmail(String str) Validate the given DOAP file.static voidwriteComment(org.codehaus.plexus.util.xml.XMLWriter writer, String comment) Write comment.static voidwriteElement(org.codehaus.plexus.util.xml.XMLWriter writer, String xmlnsPrefix, String name, String value) static voidwriteElement(org.codehaus.plexus.util.xml.XMLWriter writer, String xmlnsPrefix, String name, String value, String lang) static voidwriteHeader(org.codehaus.plexus.util.xml.XMLWriter writer) Write comments in the DOAP file header.static voidwriteRdfNodeIdElement(org.codehaus.plexus.util.xml.XMLWriter writer, String xmlnsPrefix, String name, String value) static voidwriteRdfResourceElement(org.codehaus.plexus.util.xml.XMLWriter writer, String xmlnsPrefix, String name, String value) static voidwriteStartElement(org.codehaus.plexus.util.xml.XMLWriter writer, String xmlnsPrefix, String name)
-
Field Details
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUTThe default timeout used when fetching url, i.e. 2000.- See Also:
-
RDF_RESOURCE
RDF resource attribute.- See Also:
-
RDF_NODE_ID
RDF nodeID attribute.- See Also:
-
-
Constructor Details
-
DoapUtil
public DoapUtil()
-
-
Method Details
-
writeHeader
public static void writeHeader(org.codehaus.plexus.util.xml.XMLWriter writer) Write comments in the DOAP file header.- Parameters:
writer- not null
-
writeComment
public static void writeComment(org.codehaus.plexus.util.xml.XMLWriter writer, String comment) throws IllegalArgumentException Write comment.- Parameters:
writer- not nullcomment- not null- Throws:
IllegalArgumentException- if comment is null or empty- Since:
- 1.1
-
writeElement
public static void writeElement(org.codehaus.plexus.util.xml.XMLWriter writer, String xmlnsPrefix, String name, String value) throws IllegalArgumentException - Parameters:
writer- not nullxmlnsPrefix- could be nullname- not nullvalue- could be null. In this case, the element is not written.- Throws:
IllegalArgumentException- if name is null or empty
-
writeElement
public static void writeElement(org.codehaus.plexus.util.xml.XMLWriter writer, String xmlnsPrefix, String name, String value, String lang) throws IllegalArgumentException - Parameters:
writer- not nullxmlnsPrefix- could be nullname- not nullvalue- could be null. In this case, the element is not written.lang- not null- Throws:
IllegalArgumentException- if name is null or empty
-
writeStartElement
public static void writeStartElement(org.codehaus.plexus.util.xml.XMLWriter writer, String xmlnsPrefix, String name) throws IllegalArgumentException - Parameters:
writer- not nullxmlnsPrefix- could be nullname- not null- Throws:
IllegalArgumentException- if name is null or empty- Since:
- 1.1
-
writeRdfResourceElement
public static void writeRdfResourceElement(org.codehaus.plexus.util.xml.XMLWriter writer, String xmlnsPrefix, String name, String value) throws IllegalArgumentException - Parameters:
writer- not nullxmlnsPrefix- could be nullname- not nullvalue- could be null. In this case, the element is not written.- Throws:
IllegalArgumentException- if name is null or empty
-
writeRdfNodeIdElement
public static void writeRdfNodeIdElement(org.codehaus.plexus.util.xml.XMLWriter writer, String xmlnsPrefix, String name, String value) throws IllegalArgumentException - Parameters:
writer- not nullname- not nullvalue- could be null. In this case, the element is not written.- Throws:
IllegalArgumentException- if name is null or empty
-
getContributorsWithDeveloperRole
public static List<org.apache.maven.model.Contributor> getContributorsWithDeveloperRole(org.codehaus.plexus.i18n.I18N i18n, List<org.apache.maven.model.Contributor> developersOrContributors) - Parameters:
i18n- the internationalization componentdevelopersOrContributors- list ofContributor- Returns:
- a none null list of
which have aContributordeveloperDOAP role
-
getContributorsWithDocumenterRole
public static List<org.apache.maven.model.Contributor> getContributorsWithDocumenterRole(org.codehaus.plexus.i18n.I18N i18n, List<org.apache.maven.model.Contributor> developersOrContributors) - Parameters:
i18n- the internationalization componentdevelopersOrContributors- list ofContributor- Returns:
- a none null list of
which have aContributordocumenterDOAP role
-
getContributorsWithHelperRole
public static List<org.apache.maven.model.Contributor> getContributorsWithHelperRole(org.codehaus.plexus.i18n.I18N i18n, List<org.apache.maven.model.Contributor> developersOrContributors) - Parameters:
i18n- the internationalization componentdevelopersOrContributors- list ofContributor- Returns:
- a none null list of
which have anContributorhelperDOAP role
-
getContributorsWithMaintainerRole
public static List<org.apache.maven.model.Contributor> getContributorsWithMaintainerRole(org.codehaus.plexus.i18n.I18N i18n, List<org.apache.maven.model.Contributor> developersOrContributors) - Parameters:
i18n- the internationalization componentdevelopersOrContributors- list ofContributor- Returns:
- a none null list of
which have aContributormaintainerDOAP role
-
getContributorsWithTesterRole
public static List<org.apache.maven.model.Contributor> getContributorsWithTesterRole(org.codehaus.plexus.i18n.I18N i18n, List<org.apache.maven.model.Contributor> developersOrContributors) - Parameters:
i18n- the internationalization componentdevelopersOrContributors- list ofContributor- Returns:
- a none null list of
which have aContributortesterDOAP role
-
getContributorsWithTranslatorRole
public static List<org.apache.maven.model.Contributor> getContributorsWithTranslatorRole(org.codehaus.plexus.i18n.I18N i18n, List<org.apache.maven.model.Contributor> developersOrContributors) - Parameters:
i18n- the internationalization componentdevelopersOrContributors- list ofContributor- Returns:
- a none null list of
which have aContributortranslatorDOAP role
-
getContributorsWithUnknownRole
public static List<org.apache.maven.model.Contributor> getContributorsWithUnknownRole(org.codehaus.plexus.i18n.I18N i18n, List<org.apache.maven.model.Contributor> developersOrContributors) - Parameters:
i18n- the internationalization componentdevelopersOrContributors- list ofContributor- Returns:
- a none null list of
which have anContributorunknownDOAP role
-
addOrganization
Put an organization from the pom file in the organization list.- Parameters:
name- from the pom file (e.g. Yoyodyne)url- from the pom file (e.g. http://yoyodyne.example.org/about)- Returns:
- the existing organization if a duplicate, or a new one
-
getNodeId
Get a unique (within the DoaP file) RDF blank node ID.- Returns:
- the nodeID
- See Also:
-
getOrganizations
Get the set of Organizations that people are members of.- Returns:
- Map.EntrySet of DoapUtil.Organization
-
validate
Validate the given DOAP file.- Parameters:
doapFile- not null and should exist- Returns:
- an empty list if the DOAP file is valid, otherwise a list of errors
- Since:
- 1.1
-
isValidEmail
- Parameters:
str- not null- Returns:
trueif the str parameter is a valid email,falseotherwise- Since:
- 1.1
-
fetchURL
@Deprecated public static void fetchURL(org.apache.maven.settings.Settings settings, URL url) throws IOException Deprecated.Use java.net.URL or a different library to load the URL.Pings a URL.- Parameters:
settings- ignoredurl- the URL to fetch- Throws:
NullPointerException- if url is nullIOException- if any- Since:
- 1.1
-
interpolate
public static String interpolate(String value, org.apache.maven.project.MavenProject project, org.apache.maven.settings.Settings settings) Interpolate a string with project and settings.- Parameters:
value- could be nullproject- not nullsettings- could be null- Returns:
- the value trimmed and interpolated or null if the interpolation doesn't work
- Since:
- 1.1
-