JSlim  


com.gtcgroup.jslim
Class ServiceKeyVO

java.lang.Object
  extended bycom.gtcgroup.jslim.DocumentPathSuperVO
      extended bycom.gtcgroup.jslim.ServicesSuperVO
          extended bycom.gtcgroup.jslim.ServiceKeyVO

final class ServiceKeyVO
extends ServicesSuperVO

This immutable class maintains a collection of ServiceElementVO objects which together represent a service as defined in the descriptor document(s).

The return of ArrayLists, booleans and integers are supported..

Copyright (c) 1999 - 2004 by Global Technology Consulting Group, Inc. at gtcGroup.com.
Use is authorized, provided the source is acknowledged by inclusion of this copyright notice.

Since:
v. 1.0
Author:
MDT (MarvinToll@gtcGroup.com)

Field Summary
private  java.util.LinkedHashMap lhmServiceArrayVOs
          Cache containing arrays read from descriptor documents.
private  java.util.LinkedHashMap lhmServiceElementVOs
          Cache containing ServiceElementVO objects.
 
Constructor Summary
(package private) ServiceKeyVO(boolean blnForTesting)
          Constructor.
(package private) ServiceKeyVO(org.w3c.dom.Element eleService, int intDocumentPath)
          Constructor.
  ServiceKeyVO(int intServiceType, java.lang.String strServiceKey)
          Constructor.
(package private) ServiceKeyVO(java.util.LinkedHashMap lhmServiceElementVOs, java.util.LinkedHashMap lhmServiceArrayVOs, int intDocumentPath, int intServiceType, java.lang.String strServiceKey)
          Constructor.
 
Method Summary
(package private)  boolean containsArray(java.lang.String strElementKey)
          Returns whether or not an ArrayList was read from a descriptor document and cached.
(package private)  boolean containsArrayOfNulls(java.lang.String strElementKey)
          Returns whether or not an ArrayList has a non-"null" text value.
(package private)  boolean containsElement(java.lang.String strElementKey)
          Returns whether or not an element was read from a descriptor document and cached.
(package private)  boolean containsElementTextNull(java.lang.String strElementKey)
          Returns whether or not text read from a descriptor document is "null".
(package private)  boolean containsNoArrays()
          Returns whether or not at least one ArrayList was read from a descriptor document and cached.
 boolean equals(java.lang.Object o)
           
(package private)  int getDocumentPath()
          Returns the path representation of the descriptor document.
(package private)  boolean getElementBoolean(java.lang.String strElementKey)
          Returns the boolean representation of text read from a descriptor document.
(package private)  int getElementInt(java.lang.String strElementKey)
          Returns the integer representation of text read from a descriptor document.
(package private)  java.lang.String getElementKey()
          Returns the element key representation read from a descriptor document.
(package private)  java.lang.String getElementText()
          Return the element text read from a descriptor document.
(package private)  java.lang.String getElementText(java.lang.String strElementKey)
          Returns the text of an element read from a descriptor document.
(package private)  ServiceArrayVO getServiceArrayVO(java.lang.String strElementKey)
          Returns an cloned ServiceArrayVO.
(package private)  java.util.LinkedHashMap getServiceArrayVOs()
          Returns a cloned collection of ArrayLists cached.
(package private)  ServiceElementVO getServiceElementVO(java.lang.String strElementKey)
          Returns a cloned ServiceElementVO.
(package private)  java.util.LinkedHashMap getServiceElementVOs()
          Returns a collection of ServiceElementVO objects.
(package private)  java.lang.String getServiceKey()
          Returns the service key representation read from a descriptor document.
(package private)  int getServiceType()
          Returns the service type representation read from a descriptor document.
 int hashCode()
           
(package private)  ServiceKeyVO updateServiceElementVO(ServiceElementVO serviceElementVO)
          Returns a new ServiceKeyVO with updated cache.
(package private)  ServiceKeyVO updateServiceKeyVO(org.w3c.dom.Element eleService, boolean blnOverWriteElement, int intDocumentPath)
          Returns a new ServiceKeyVO with updated cache.
(package private)  ServiceKeyVO updateServiceKeyVO(org.w3c.dom.Element eleService, int intDocumentPath)
          Returns a new ServiceKeyVO with updated cache.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lhmServiceElementVOs

private final java.util.LinkedHashMap lhmServiceElementVOs
Cache containing ServiceElementVO objects.


lhmServiceArrayVOs

private final java.util.LinkedHashMap lhmServiceArrayVOs
Cache containing arrays read from descriptor documents.

Constructor Detail

ServiceKeyVO

public ServiceKeyVO(int intServiceType,
                    java.lang.String strServiceKey)
Constructor.

Parameters:
intServiceType - Represents the service type read from a descriptor document.
strServiceKey - Represents the service key read from a descriptor document.

ServiceKeyVO

ServiceKeyVO(boolean blnForTesting)
Constructor. (This constructor is used for testing.)

Parameters:
blnForTesting - Used to "true" for testing.

ServiceKeyVO

ServiceKeyVO(org.w3c.dom.Element eleService,
             int intDocumentPath)
Constructor.

Parameters:
eleService - A portion of a descriptor document representing one service.
intDocumentPath - Represents the path of a descriptor document.

ServiceKeyVO

ServiceKeyVO(java.util.LinkedHashMap lhmServiceElementVOs,
             java.util.LinkedHashMap lhmServiceArrayVOs,
             int intDocumentPath,
             int intServiceType,
             java.lang.String strServiceKey)
Constructor.

Parameters:
lhmServiceElementVOs - Represents elements read from descriptor documents.
lhmServiceArrayVOs - Represents arrays read from descriptor documents.
intDocumentPath - Represents the path of a descriptor document.
intServiceType - Represents the service type read from a descriptor document.
strServiceKey - Represents the service key read from a descriptor document.
Method Detail

containsArray

final boolean containsArray(java.lang.String strElementKey)
Returns whether or not an ArrayList was read from a descriptor document and cached.

Parameters:
strElementKey - Represents an element key from a descriptor document.
Returns:
Whether or not an ArrayList was read from a descriptor document.

containsArrayOfNulls

final boolean containsArrayOfNulls(java.lang.String strElementKey)
Returns whether or not an ArrayList has a non-"null" text value.

Parameters:
strElementKey - Represents an element key from a descriptor document.
Returns:
Whether or not an ArrayList has a non-"null" text value.

containsElement

final boolean containsElement(java.lang.String strElementKey)
Returns whether or not an element was read from a descriptor document and cached.

Parameters:
strElementKey - Represents an element key from a descriptor document.
Returns:
Whether or not an elemant value is cached.

containsElementTextNull

final boolean containsElementTextNull(java.lang.String strElementKey)
Returns whether or not text read from a descriptor document is "null".

Parameters:
strElementKey - Represents an element key from a descriptor document.
Returns:
Whether or not text from a descriptor document is "null".

containsNoArrays

final boolean containsNoArrays()
Returns whether or not at least one ArrayList was read from a descriptor document and cached.

Returns:
Whether or not at least one ArrayList was read from a descriptor document.

getElementBoolean

final boolean getElementBoolean(java.lang.String strElementKey)
                         throws JSlimException
Returns the boolean representation of text read from a descriptor document.

Parameters:
strElementKey - Represents an element key from a descriptor document.
Returns:
The boolean representation of an element.
Throws:
JSlimException - if an exception encountered.

getElementInt

final int getElementInt(java.lang.String strElementKey)
                 throws JSlimException
Returns the integer representation of text read from a descriptor document.

Parameters:
strElementKey - Represents an element key from a descriptor document.
Returns:
The integer representation of an element.
Throws:
JSlimException - if an exception encountered.

getElementText

final java.lang.String getElementText(java.lang.String strElementKey)
                               throws JSlimException
Returns the text of an element read from a descriptor document.

Parameters:
strElementKey - Represents an element key from a descriptor document.
Returns:
The text of an element.
Throws:
JSlimException - if an exception encountered.

getServiceArrayVO

final ServiceArrayVO getServiceArrayVO(java.lang.String strElementKey)
                                throws JSlimException
Returns an cloned ServiceArrayVO.

Parameters:
strElementKey - Represents an element key from a descriptor document.
Returns:
A cloned ServiceArrayVO.
Throws:
JSlimException - if an exception encountered.

getServiceArrayVOs

final java.util.LinkedHashMap getServiceArrayVOs()
Returns a cloned collection of ArrayLists cached.

Returns:
A cloned collection of ArrayLists cached.

getServiceElementVO

final ServiceElementVO getServiceElementVO(java.lang.String strElementKey)
                                    throws JSlimException
Returns a cloned ServiceElementVO.

Parameters:
strElementKey - Represents an element key from a descriptor document.
Returns:
A cloned ServiceElementVO.
Throws:
JSlimException - if an exception encountered.

getServiceElementVOs

final java.util.LinkedHashMap getServiceElementVOs()
Returns a collection of ServiceElementVO objects.

Returns:
A collection of ServiceElementVO objects.

updateServiceKeyVO

final ServiceKeyVO updateServiceKeyVO(org.w3c.dom.Element eleService,
                                      int intDocumentPath)
                               throws JSlimException
Returns a new ServiceKeyVO with updated cache. Text values will not be over written if there is a duplicate element key within a service.

Parameters:
eleService - A portion of a descriptor document representing one service.
intDocumentPath - Represents the path of a descriptor document.
Returns:
A new ServiceKeyVO with updated cache.
Throws:
JSlimException - if an exception encountered.

updateServiceKeyVO

final ServiceKeyVO updateServiceKeyVO(org.w3c.dom.Element eleService,
                                      boolean blnOverWriteElement,
                                      int intDocumentPath)
                               throws JSlimException
Returns a new ServiceKeyVO with updated cache.

Parameters:
eleService - A portion of a descriptor document representing one service.
blnOverWriteElement - Indicates current text values may be over written.
intDocumentPath - Represents the path of a descriptor document.
Returns:
A new ServiceKeyVO with updated cache.
Throws:
JSlimException - if an exception encountered.

updateServiceElementVO

final ServiceKeyVO updateServiceElementVO(ServiceElementVO serviceElementVO)
Returns a new ServiceKeyVO with updated cache.

Parameters:
serviceElementVO - Immutable class containing text and descriptor document traceability.
Returns:
A new ServiceKeyVO with updated cache.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class ServicesSuperVO

hashCode

public int hashCode()
Overrides:
hashCode in class ServicesSuperVO

getServiceType

final int getServiceType()
Returns the service type representation read from a descriptor document.

Returns:
The service type representation.

getServiceKey

final java.lang.String getServiceKey()
Returns the service key representation read from a descriptor document.

Returns:
The service key representation.

getElementKey

final java.lang.String getElementKey()
Returns the element key representation read from a descriptor document.

Returns:
The element key representation.

getElementText

final java.lang.String getElementText()
Return the element text read from a descriptor document.

Returns:
The element text read from a descriptor document.

getDocumentPath

final int getDocumentPath()
Returns the path representation of the descriptor document.

Returns:
The path representation of the descriptor document.

JSlim  


Copyright (c) 1999 - 2004 by Global Technology Consulting Group, Inc. at gtcGroup.com.
Use is authorized, provided the source is acknowledged by inclusion of this copyright notice.