org.apache.maven.plugin.registry.TrackableBase Maven / Gradle / Ivy
The newest version!
/*
=================== DO NOT EDIT THIS FILE ====================
Generated by Modello 1.0.1 on 2009-08-06 15:14:41,
any modifications will be overwritten.
==============================================================
*/
package org.apache.maven.plugin.registry;
/**
* common base class that contains code to track the source for
* this instance (USER|GLOBAL).
*
* @version $Revision$ $Date$
*/
public class TrackableBase
implements java.io.Serializable
{
public static final String USER_LEVEL = "user-level";
public static final String GLOBAL_LEVEL = "global-level";
private String sourceLevel = USER_LEVEL;
private boolean sourceLevelSet = false;
public void setSourceLevel( String sourceLevel )
{
if ( sourceLevelSet )
{
throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
}
else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
{
throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
}
else
{
this.sourceLevel = sourceLevel;
this.sourceLevelSet = true;
}
}
public String getSourceLevel()
{
return sourceLevel;
}
}