com.sage.orion.sdata.servlet.accpac
Class ReferencedKeyField

java.lang.Object
  extended by com.sage.orion.sdata.servlet.accpac.JiBXConfigurationAbstractResource
      extended by com.sage.orion.sdata.servlet.accpac.ReferencedKeyField
All Implemented Interfaces:
JiBXConfigurationResource

public class ReferencedKeyField
extends JiBXConfigurationAbstractResource

The ReferencedKeyField is a simple structure used in parsing the ViewResourceMapping files.

A referenced key field defines which field of 'this' Resource is to be used to key into 'that' ReferencedResource. Each field of this resource maps to the corresponding field in the identifying key of the referenced resource.

Frequently there will only be one such field, but there may sometimes be more, and they will map in the order they are listed.

In addition for some views it is not actually a field that provides the value; it is a static value.

Like the other similar classes, an instance of this class is designed to be built by the JiBX parser and then queried elsewhere.


Constructor Summary
ReferencedKeyField()
          constructs an instance of the ReferencedKeyField class.
ReferencedKeyField(java.lang.String viewFieldName)
          constructs an instance of the ReferencedKeyField class, using the specified name
 
Method Summary
 java.lang.String getFixedValue()
          gets the fixed value.
 java.lang.String getViewFieldName()
          gets the internal name.
 boolean isUsingFixedValue()
          returns whether the field is using a fixed value or not.
protected  void onEndBuilding()
          This will be called at the end of the building phase.
 void setFixedValue(java.lang.String value)
          sets the fixed value.
 void setViewFieldName(java.lang.String name)
          sets the internal name.
 
Methods inherited from class com.sage.orion.sdata.servlet.accpac.JiBXConfigurationAbstractResource
addConfigurationError, endBuilding, ensureStillBuilding, getConfigurationErrors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferencedKeyField

public ReferencedKeyField()
constructs an instance of the ReferencedKeyField class.


ReferencedKeyField

public ReferencedKeyField(java.lang.String viewFieldName)
constructs an instance of the ReferencedKeyField class, using the specified name

Parameters:
viewFieldName - the internal name of the field in this resource which maps to the corresponding key field in the referenced resource
Method Detail

getFixedValue

public java.lang.String getFixedValue()
gets the fixed value. This is the value which is placed in the key field in the related resource.

Returns:
the value which is placed in the key field in the related resource.

getViewFieldName

public java.lang.String getViewFieldName()
gets the internal name. This is the Accpac field name in this resource which maps to a key field in the related resource.

If the field is using a fixed value (isUsingFixedValue() returns true) this will return a null value.

Returns:
the internal/Accpac name of the field which maps to a key field in the referenced resource.

isUsingFixedValue

public boolean isUsingFixedValue()
returns whether the field is using a fixed value or not.

The caller should check this before deciding which getter to call.

Returns:
true if and only if this object has a fixed value
See Also:
getViewFieldName()

setViewFieldName

public void setViewFieldName(java.lang.String name)
sets the internal name. This is the Accpac field name in this resource which maps to a key field in the related resource.

Parameters:
name - the internal Accpac name of the field to be mapped to a key field in the referenced resource

setFixedValue

public void setFixedValue(java.lang.String value)
sets the fixed value. This is the value which is placed in the key field in the related resource.

If a fixed value is provided a name must not be provided using setViewFieldName(String)

Parameters:
value - the internal Accpac name of the field to be mapped to a key field in the referenced resource

onEndBuilding

protected void onEndBuilding()
This will be called at the end of the building phase. The subclass must perform any required actions at that time, such as sealing lists, checking configurations, etc. It may call JiBXConfigurationAbstractResource.addConfigurationError(java.lang.String) during this call.

Specified by:
onEndBuilding in class JiBXConfigurationAbstractResource


Copyright © 2011 Sage Software, Inc. All rights reserved.