Class TLcyCompositeModelReferenceParser

java.lang.Object
com.luciad.lucy.util.TLcyGenericComposite<ILcdModelReferenceParser>
com.luciad.lucy.model.TLcyCompositeModelReferenceParser
All Implemented Interfaces:
ILcdModelReferenceParser, Iterable<ILcdModelReferenceParser>

public class TLcyCompositeModelReferenceParser extends TLcyGenericComposite<ILcdModelReferenceParser> implements ILcdModelReferenceParser

Composite implementation (see composite design pattern) of ILcdModelReferenceParser. It keeps a list of associated ILcdModelReferenceParsers. When it is asked to parse a model reference, it loops over its associated ILcdModelReferenceParsers to find one that can parse the input. The model reference provided by that decoder is returned.

When creating a new TLcyCompositeModelReferenceParser using the default constructor, the created instance will only work on/with the registered instances on this composite instance.

When creating a new TLcyCompositeModelReferenceParser using the constructor specifying an ILcyLucyEnv instance, the created composite will work on the Lucy back-end services. It will use all registered ILcdModelReferenceParser instances of the Lucy back-end, adding and/or removing an ILcdModelReferenceParser will add/remove the parser as service from Lucy, ... .

Parsing an ILcdModelReference from its string representation using the back-end based implementation can be done by creating a new instance of this class:


   //Create a new instance whenever you need it
   TLcyCompositeModelReferenceParser parser = new TLcyCompositeModelReferenceParser( aLucyEnv );
   try{
     ILcdModelReference modelReference = parser.parseModelReference( aModelReferenceAsString );
   } catch ( ParseException aException ){
     //exception occurred during the parsing
   }
   //There is no need to keep a reference to the composite instance, you can create a new one
   //the next time you would need it
   provider = null;
 
Since:
11.2.x
  • Constructor Details

  • Method Details

    • parseModelReference

      public ILcdModelReference parseModelReference(String aModelReferenceAsString) throws ParseException
      Description copied from interface: ILcdModelReferenceParser
      Returns the ILcdModelReference that corresponds to the specified string representation.
      Specified by:
      parseModelReference in interface ILcdModelReferenceParser
      Parameters:
      aModelReferenceAsString - the String representation to be converted to an ILcdModelReference.
      Returns:
      the ILcdModelReference that corresponds to the specified string, never null.
      Throws:
      ParseException - if this parser cannot convert the specified string into a model reference (e.g. if the code is not supported or if the code was not valid)