com.legstar.cob2xsd
Class Cob2XsdIO

java.lang.Object
  extended by com.legstar.cob2xsd.Cob2Xsd
      extended by com.legstar.cob2xsd.Cob2XsdIO

public class Cob2XsdIO
extends Cob2Xsd

Common code for file translation (as opposed to string translation).


Constructor Summary
Cob2XsdIO(Cob2XsdModel model)
           
 
Method Summary
protected static String getUniqueTargetNamespace(String baseName, String targetNamespacePrefix)
          TargetNamespace, if it is not null, is completed with the baseName.
 File translate(File cobolFile, File target, boolean appendBaseFileNameToNamespace)
          Translates a single COBOL source file.
 
Methods inherited from class com.legstar.cob2xsd.Cob2Xsd
checkCobolSourceFile, checkTarget, clean, createXmlSchema, emitModel, emitXsd, getErrorHistory, getModel, getNonUniqueCobolNames, getNonUniqueCobolNames, lex, parse, toModel, translate, xsdToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cob2XsdIO

public Cob2XsdIO(Cob2XsdModel model)
Method Detail

translate

public File translate(File cobolFile,
                      File target,
                      boolean appendBaseFileNameToNamespace)
               throws RecognizerException,
                      XsdGenerationException
Translates a single COBOL source file.

When requested the file base name is appended to the target namespace.

Parameters:
cobolFile - COBOL source file
target - target file or folder
appendBaseFileNameToNamespace - true to append base file name to namespace
Returns:
the XML Schema
Throws:
RecognizerException - if parser fails
XsdGenerationException - if COBOL model interpretation fails

getUniqueTargetNamespace

protected static String getUniqueTargetNamespace(String baseName,
                                                 String targetNamespacePrefix)
TargetNamespace, if it is not null, is completed with the baseName.

Parameters:
baseName - A name, derived from the COBOL file name, that can be used to identify generated artifacts
targetNamespacePrefix - the namespace prefix
Returns:
the previous value of the model targetNamespace field


Copyright © 2015 LegSem. All rights reserved.