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 voidFetch a 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 IDstatic Set<Map.Entry<String, DoapUtil.Organization>> get the set of Organizations that people are members ofstatic 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 headerstatic 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_NODE_ID
-
-
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
-
isValidEmail
- Parameters:
str- not null- Returns:
trueif the str parameter is a valid email,falseotherwise.- Since:
- 1.1
-
fetchURL
public static void fetchURL(org.apache.maven.settings.Settings settings, URL url) throws IOException Fetch a URL.- Parameters:
settings- the user settings used to fetch the URL with an active proxy, if definedurl- the URL to fetch- Throws:
IOException- if any- Since:
- 1.1
- See Also:
-
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
-