com.perforce.p4java.impl.mapbased.rpc.packet.helper
Class RpcPacketFieldRule

java.lang.Object
  extended by com.perforce.p4java.impl.mapbased.rpc.packet.helper.RpcPacketFieldRule
Direct Known Subclasses:
RpcPacketFieldPatternRule, RpcPacketFieldRangeRule

public abstract class RpcPacketFieldRule
extends Object

Super class representing the rule for skipping the charset conversion of the RPC packet field values (bytes). Leave those field values as bytes instead of converting them to strings.


Field Summary
static String FIELD_PATTERN
          The key for storing the field pattern in a command map.
protected  boolean skipConversion
          If true, skip charset conversion; leave the value as is in bytes.
static String START_FIELD
          The key for storing the start field name in a command map.
static String STOP_FIELD
          The key for storing the stop field name in a command map.
 
Constructor Summary
RpcPacketFieldRule()
           
 
Method Summary
static RpcPacketFieldRule getInstance(Map<String,Object> cmdMap)
          Factory static method to create an instance of a subclass based on the content of a command map.
 boolean isSkipConversion()
          Checks if is skip conversion.
abstract  void update(String fieldName)
          Updates the conversion rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIELD_PATTERN

public static final String FIELD_PATTERN
The key for storing the field pattern in a command map.

See Also:
Constant Field Values

START_FIELD

public static final String START_FIELD
The key for storing the start field name in a command map.

See Also:
Constant Field Values

STOP_FIELD

public static final String STOP_FIELD
The key for storing the stop field name in a command map.

See Also:
Constant Field Values

skipConversion

protected boolean skipConversion
If true, skip charset conversion; leave the value as is in bytes.

Constructor Detail

RpcPacketFieldRule

public RpcPacketFieldRule()
Method Detail

getInstance

public static RpcPacketFieldRule getInstance(Map<String,Object> cmdMap)
Factory static method to create an instance of a subclass based on the content of a command map. Note that the instance creation will be processed in the order listed below.

The existing of a FIELD_PATTERN key with a string value will create a RpcPacketFieldPatternRule object.

The existing of both the START_FIELD and STOP_FIELD keys with string values will create a RpcPacketFieldRangeRule object.


update

public abstract void update(String fieldName)
Updates the conversion rule.

Parameters:
fieldName - the field name

isSkipConversion

public boolean isSkipConversion()
Checks if is skip conversion.

Returns:
true, if is skip conversion


Copyright © 2015 Perforce Software. All Rights Reserved.