sk.robotics.rlcs.web.editor
Class AgentDesc

java.lang.Object
  extended by sk.robotics.rlcs.web.editor.AgentDesc

public class AgentDesc
extends java.lang.Object

Agent description, as stored in XML, including field descriptions.


Nested Class Summary
static class AgentDesc.FieldDesc
          Information about a field in agent config.
 
Field Summary
 java.lang.String configClassName
          Agent config class fully qualified name.
 java.lang.String description
          Agent description.
 java.lang.String displayName
          Display name.
 AgentDesc.FieldDesc[] fields
          List of fields.
 
Constructor Summary
AgentDesc()
           
 
Method Summary
 boolean allowAdd()
           
 void clearDefaults(Agent.Cfg cfg)
          Replace default field values with nulls in agent config.
 Agent.Cfg createEmptyCfg()
          Create new instance of agent config object.
 Agent.Cfg getDefaultCfg()
          Create config instance with default field values.
 java.lang.String getDescription()
           
 java.lang.String getDisplayName()
           
 AgentDesc.FieldDesc getField(java.lang.String fieldName)
          Get field description for given field.
 void setDefaults(Agent.Cfg cfg)
          Set default values for unset fields of agent config.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configClassName

public java.lang.String configClassName
Agent config class fully qualified name.


displayName

public java.lang.String displayName
Display name. If null, is generated from the config class name, by stripping standard prefix (sk.robotics.rlcs.agents.) and suffix ($Cfg).


description

public java.lang.String description
Agent description. HTML formatted.


fields

public AgentDesc.FieldDesc[] fields
List of fields.

Constructor Detail

AgentDesc

public AgentDesc()
Method Detail

getField

public AgentDesc.FieldDesc getField(java.lang.String fieldName)
Get field description for given field. This method also searches for the field in parent classes, if needed.


createEmptyCfg

public Agent.Cfg createEmptyCfg()
Create new instance of agent config object. All fields will be cleared to null, except those annotated with Agent$Cfg$NoDefault.


getDefaultCfg

public Agent.Cfg getDefaultCfg()
Create config instance with default field values. Contains field filled with default values as initialized by constructor, except fields annotated with Agent$Cfg$NoDefault, whose values are cleared to null.


setDefaults

public void setDefaults(Agent.Cfg cfg)
Set default values for unset fields of agent config.


clearDefaults

public void clearDefaults(Agent.Cfg cfg)
Replace default field values with nulls in agent config.


getDisplayName

public java.lang.String getDisplayName()

getDescription

public java.lang.String getDescription()

allowAdd

public boolean allowAdd()