|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.maven.plugin.doap.DoapUtil
public class DoapUtil
Utility class for DoapMojo
class.
Nested Class Summary | |
---|---|
static class |
DoapUtil.Organization
Utility class for keeping track of DOAP organizations in the DoaP mojo. |
Field Summary | |
---|---|
static int |
DEFAULT_TIMEOUT
The default timeout used when fetching url, i.e. 2000. |
protected static String |
RDF_NODE_ID
RDF nodeID attribute |
protected static String |
RDF_RESOURCE
RDF resource attribute |
Constructor Summary | |
---|---|
DoapUtil()
|
Method Summary | |
---|---|
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(XMLWriter writer,
String comment)
Write comment. |
static void |
writeElement(XMLWriter writer,
String xmlnsPrefix,
String name,
String value)
|
static void |
writeElement(XMLWriter writer,
String xmlnsPrefix,
String name,
String value,
String lang)
|
static void |
writeHeader(XMLWriter writer)
Write comments in the DOAP file header |
static void |
writeRdfNodeIdElement(XMLWriter writer,
String xmlnsPrefix,
String name,
String value)
|
static void |
writeRdfResourceElement(XMLWriter writer,
String xmlnsPrefix,
String name,
String value)
|
static void |
writeStartElement(XMLWriter writer,
String xmlnsPrefix,
String name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_TIMEOUT
protected static final String RDF_RESOURCE
protected static final String RDF_NODE_ID
Constructor Detail |
---|
public DoapUtil()
Method Detail |
---|
public static void writeHeader(XMLWriter writer)
writer
- not nullpublic static void writeComment(XMLWriter writer, String comment) throws IllegalArgumentException
writer
- not nullcomment
- not null
IllegalArgumentException
- if comment is null or emptypublic static void writeElement(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(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(XMLWriter writer, String xmlnsPrefix, String name) throws IllegalArgumentException
writer
- not nullxmlnsPrefix
- could be nullname
- not null
IllegalArgumentException
- if name is null or emptypublic static void writeRdfResourceElement(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(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 null
true
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 fetch
IOException
- 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 null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |