diff --git a/proposal/myrmidon/src/java/org/apache/antlib/cvslib/CvsUser.java b/proposal/myrmidon/src/java/org/apache/antlib/cvslib/CvsUser.java new file mode 100644 index 000000000..fa0b34aea --- /dev/null +++ b/proposal/myrmidon/src/java/org/apache/antlib/cvslib/CvsUser.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.antlib.cvslib; + +import org.apache.myrmidon.api.TaskException; +import org.apache.avalon.excalibur.i18n.Resources; +import org.apache.avalon.excalibur.i18n.ResourceManager; + +/** + * Represents a CVS user with a userID and a full name. + * + * @author Peter Donald + * @author Jeff Martin + * @version $Revision$ $Date$ + */ +public class CvsUser +{ + private final static Resources REZ = + ResourceManager.getPackageResources( CvsUser.class ); + + private String m_userID; + private String m_displayName; + + public void setDisplayname( final String displayName ) + { + m_displayName = displayName; + } + + public void setUserid( final String userID ) + { + m_userID = userID; + } + + String getUserID() + { + return m_userID; + } + + String getDisplayname() + { + return m_displayName; + } + + void validate() + throws TaskException + { + if( null == m_userID ) + { + final String message = REZ.getString( "changelog.nouserid.error" ); + throw new TaskException( message ); + } + if( null == m_displayName ) + { + final String message = + REZ.getString( "changelog.nodisplayname.error", m_userID ); + throw new TaskException( message ); + } + } +} diff --git a/proposal/myrmidon/src/java/org/apache/antlib/cvslib/Resources.properties b/proposal/myrmidon/src/java/org/apache/antlib/cvslib/Resources.properties new file mode 100644 index 000000000..fc14f9b89 --- /dev/null +++ b/proposal/myrmidon/src/java/org/apache/antlib/cvslib/Resources.properties @@ -0,0 +1,2 @@ +changelog.nodisplayname.error=Displayname attribute must be set for userID "{0}". +changelog.nouserid.error=Username attribute must be set. \ No newline at end of file