com.apelon.dts.client.plugins
Class DefaultCodeAndIdGenerator

java.lang.Object
  extended by com.apelon.dts.client.common.CodeAndIDGenerator
      extended by com.apelon.dts.client.plugins.DefaultCodeAndIdGenerator

public class DefaultCodeAndIdGenerator
extends CodeAndIDGenerator

Default code and ID generator for concepts or terms.

Copyright: Copyright (c) 2003

Company: Apelon, Inc.

Version:
DTS 3.0.0
Author:
Apelon, Inc.

Field Summary
 
Fields inherited from class com.apelon.dts.client.common.CodeAndIDGenerator
CODE_AND_ID_GENERATOR_FILE_PATH, CODE_AND_ID_GENERATOR_PACKAGE_PATH, RELATIVE_CODE_AND_ID_GENERATOR_FILE_PATH
 
Constructor Summary
DefaultCodeAndIdGenerator(ServerConnection sc)
          Constructs CodeAndIDGenerator.
 
Method Summary
 String getCode(DTSObject conceptOrTerm)
          Returns null to get default implementation when passing the DTSConcept to the BaseLocalConceptQuery.addConcept(com.apelon.dts.client.concept.DTSConcept concept) method, or Term to the BaseTermQuery.addTerm(com.apelon.dts.client.term.Term newTerm) method.
 String getDescription()
          Returns the description of the default code and ID generator.
 int getId(DTSObject conceptOrTerm)
          Returns -1 to get the default implementation when passing the DTSConcept to the BaseLocalConceptQuery.addConcept(com.apelon.dts.client.concept.DTSConcept concept) method, or Term to the BaseTermQuery.addTerm(com.apelon.dts.client.term.Term newTerm) method.
 
Methods inherited from class com.apelon.dts.client.common.CodeAndIDGenerator
getCodeAndIDGeneratorFilePath, getDefaultImplClass, getServerConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCodeAndIdGenerator

public DefaultCodeAndIdGenerator(ServerConnection sc)
Constructs CodeAndIDGenerator.

Parameters:
sc - ServerConnection which may be used to instantiate any of the DTS query classes
Method Detail

getCode

public String getCode(DTSObject conceptOrTerm)
Returns null to get default implementation when passing the DTSConcept to the BaseLocalConceptQuery.addConcept(com.apelon.dts.client.concept.DTSConcept concept) method, or Term to the BaseTermQuery.addTerm(com.apelon.dts.client.term.Term newTerm) method. At that time a "C" or "T" will be prepended to the auto generated ID, depending on whether the DTSObject is a DTSConcept or a Term.

Specified by:
getCode in class CodeAndIDGenerator
Parameters:
conceptOrTerm - new concept or term, will be updated with null code
Returns:
null

getId

public int getId(DTSObject conceptOrTerm)
Returns -1 to get the default implementation when passing the DTSConcept to the BaseLocalConceptQuery.addConcept(com.apelon.dts.client.concept.DTSConcept concept) method, or Term to the BaseTermQuery.addTerm(com.apelon.dts.client.term.Term newTerm) method. At that time an auto generated sequence number will be stored as the ID.

Specified by:
getId in class CodeAndIDGenerator
Parameters:
conceptOrTerm - new concept or term, will be updated with ID of -1
Returns:
-1

getDescription

public String getDescription()
Returns the description of the default code and ID generator.

Specified by:
getDescription in class CodeAndIDGenerator
Returns:
description of the default code and ID generator


Copyright © 2011. All Rights Reserved.