Comments in event definition data classes
Some comments were missing in the classes used to load event definitions from the XML file. They have been added.
This commit is contained in:
parent
75c5245764
commit
1dd1da5ae3
9 changed files with 91 additions and 2 deletions
|
@ -23,6 +23,11 @@ public class EntityEventField
|
|||
private EventFieldEntityType entityType;
|
||||
|
||||
|
||||
/**
|
||||
* Gets the type of entities this field references.
|
||||
*
|
||||
* @return the type of entities this field references
|
||||
*/
|
||||
public EventFieldEntityType getEntityType( )
|
||||
{
|
||||
return this.entityType;
|
||||
|
|
|
@ -53,30 +53,55 @@ public class EventDefinition
|
|||
private List< EventFieldBase > fields = new ArrayList< EventFieldBase >( );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the identifier.
|
||||
*
|
||||
* @return the identifier
|
||||
*/
|
||||
public String getIdentifier( )
|
||||
{
|
||||
return this.identifier;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the priority.
|
||||
*
|
||||
* @return the priority
|
||||
*/
|
||||
public int getPriority( )
|
||||
{
|
||||
return ( this.priority == null ) ? 2 : this.priority;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the priority is adjustable.
|
||||
*
|
||||
* @return <code>true</code> if the priority is adjustable
|
||||
*/
|
||||
public boolean isAdjustable( )
|
||||
{
|
||||
return ( this.adjustable == null ) ? true : this.adjustable;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the prefix of the name and template strings.
|
||||
*
|
||||
* @return the prefix of the name and template strings.
|
||||
*/
|
||||
public String getI18NStrings( )
|
||||
{
|
||||
return this.i18nStrings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Allows iteration over the event definition's fields
|
||||
*
|
||||
* @return an iterator on the event definition's fields
|
||||
*/
|
||||
@Override
|
||||
public Iterator< EventFieldBase > iterator( )
|
||||
{
|
||||
|
@ -84,6 +109,13 @@ public class EventDefinition
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verify fields data
|
||||
*
|
||||
* <p>
|
||||
* If no fields are defined, make sure the list is not <code>null</code>; otherwise iterate over
|
||||
* the fields to call their own data checks methods.
|
||||
*/
|
||||
@Override
|
||||
public void verifyData( )
|
||||
throws DataImportException
|
||||
|
|
|
@ -42,6 +42,12 @@ public class EventDefinitions
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verify the list of definitions
|
||||
*
|
||||
* <p>
|
||||
* Make sure the list of definitions is not empty, then call the definitions' data check method.
|
||||
*/
|
||||
@Override
|
||||
public void verifyData( )
|
||||
throws DataImportException
|
||||
|
|
|
@ -38,12 +38,22 @@ public abstract class EventFieldBase
|
|||
public abstract EventFieldType getType( );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the field's identifier.
|
||||
*
|
||||
* @return the field's identifier
|
||||
*/
|
||||
public String getIdentifier( )
|
||||
{
|
||||
return this.identifier;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the field is required or optional.
|
||||
*
|
||||
* @return <code>true</code> if the field is required
|
||||
*/
|
||||
public boolean isRequired( )
|
||||
{
|
||||
return this.required == null ? true : this.required;
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package com.deepclone.lw.cli.xmlimport.data.evdef;
|
||||
|
||||
|
||||
/** Types of entities which can be referenced through entity fields */
|
||||
/** Types of entities which can be referenced through entity fields
|
||||
*
|
||||
* @author <a href="mailto:tseeker@legacyworlds.com">E. Benoît</a>
|
||||
*/
|
||||
public enum EventFieldEntityType {
|
||||
|
||||
/** Empires */
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package com.deepclone.lw.cli.xmlimport.data.evdef;
|
||||
|
||||
|
||||
/** Types of event fields as they are stored in the definition file */
|
||||
/** Types of event fields as they are stored in the definition file
|
||||
*
|
||||
* @author <a href="mailto:tseeker@legacyworlds.com">E. Benoît</a>
|
||||
*/
|
||||
public enum EventFieldType {
|
||||
|
||||
/** An integer field */
|
||||
|
|
|
@ -25,12 +25,22 @@ public class IntegerEventField
|
|||
private Integer max;
|
||||
|
||||
|
||||
/**
|
||||
* Gets the minimal value allowed for the field.
|
||||
*
|
||||
* @return the minimal value allowed for the field
|
||||
*/
|
||||
public Integer getMin( )
|
||||
{
|
||||
return this.min;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the maximal value allowed for the field.
|
||||
*
|
||||
* @return the maximal value allowed for the field
|
||||
*/
|
||||
public Integer getMax( )
|
||||
{
|
||||
return this.max;
|
||||
|
|
|
@ -26,12 +26,22 @@ public class RealEventField
|
|||
private Double max;
|
||||
|
||||
|
||||
/**
|
||||
* Gets the minimal value for the field.
|
||||
*
|
||||
* @return the minimal value for the field
|
||||
*/
|
||||
public Double getMin( )
|
||||
{
|
||||
return this.min;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the maximal value for the field.
|
||||
*
|
||||
* @return the maximal value for the field
|
||||
*/
|
||||
public Double getMax( )
|
||||
{
|
||||
return this.max;
|
||||
|
|
|
@ -28,12 +28,22 @@ public class TextEventField
|
|||
private Integer maxLength;
|
||||
|
||||
|
||||
/**
|
||||
* Gets the field's minimum length.
|
||||
*
|
||||
* @return the field's minimum length
|
||||
*/
|
||||
public Integer getMinLength( )
|
||||
{
|
||||
return this.minLength;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the field's maximum length.
|
||||
*
|
||||
* @return the field's maximum length
|
||||
*/
|
||||
public Integer getMaxLength( )
|
||||
{
|
||||
return this.maxLength;
|
||||
|
|
Reference in a new issue