@Test public void testFormatTypeName() { List < String > nonUniqueCobolNames = new ArrayList < String >(); nonUniqueCobolNames.add("AB9CD-EF"); CobolDataItem cobolDataItem = new CobolDataItem("AB9CD-EF"); cobolDataItem.setSrceLine(18); assertEquals("Ab9CdEf18", XsdDataItem.formatTypeName("ab9CdEf", cobolDataItem, nonUniqueCobolNames, defaultConfig, null, 0)); configProps.put(Cob2XsdConfig.NAME_CONFLICT_PREPEND_PARENT_NAME, Boolean.toString(true)); Cob2XsdConfig config = new Cob2XsdConfig(configProps); CobolDataItem cobolParent = new CobolDataItem("COBOL-PARENT"); XsdDataItem xsdParent = new XsdDataItem(cobolParent, config, null, 0, nonUniqueCobolNames, _errorHandler); assertEquals("CobolParentAb9CdEf", XsdDataItem.formatTypeName( "ab9CdEf", cobolDataItem, nonUniqueCobolNames, config, xsdParent, 0)); }
public static String formatTypeName(final String elementName, final CobolDataItem cobolDataItem, final List < String > nonUniqueCobolNames, final Cob2XsdConfig config, final XsdDataItem parent, final int order) { StringBuilder sb = new StringBuilder(); sb.append(Character.toUpperCase(elementName.charAt(0))); sb.append(elementName.substring(1)); if (nonUniqueCobolNames.contains(cobolDataItem.getCobolName())) { if (config.nameConflictPrependParentName()) { if (parent != null) { sb.insert(0, parent.getXsdTypeName()); } } else { sb.append(cobolDataItem.getSrceLine()); } } return sb.toString(); }
XsdDataItem { public static String formatTypeName(final String elementName, final CobolDataItem cobolDataItem, final List < String > nonUniqueCobolNames, final Cob2XsdConfig config, final XsdDataItem parent, final int order) { StringBuilder sb = new StringBuilder(); sb.append(Character.toUpperCase(elementName.charAt(0))); sb.append(elementName.substring(1)); if (nonUniqueCobolNames.contains(cobolDataItem.getCobolName())) { if (config.nameConflictPrependParentName()) { if (parent != null) { sb.insert(0, parent.getXsdTypeName()); } } else { sb.append(cobolDataItem.getSrceLine()); } } return sb.toString(); } }
XsdDataItem { public static String formatTypeName(final String elementName, final CobolDataItem cobolDataItem, final List < String > nonUniqueCobolNames, final Cob2XsdConfig config, final XsdDataItem parent, final int order) { StringBuilder sb = new StringBuilder(); sb.append(Character.toUpperCase(elementName.charAt(0))); sb.append(elementName.substring(1)); if (nonUniqueCobolNames.contains(cobolDataItem.getCobolName())) { if (config.nameConflictPrependParentName()) { if (parent != null) { sb.insert(0, parent.getXsdTypeName()); } } else { sb.append(cobolDataItem.getSrceLine()); } } return sb.toString(); } XsdDataItem(final CobolDataItem cobolDataItem,
            final Cob2XsdConfig config, final XsdDataItem parent,
            final int order, final List < String > nonUniqueCobolNames,
            final RecognizerErrorHandler errorHandler); }
XsdDataItem { public static String formatTypeName(final String elementName, final CobolDataItem cobolDataItem, final List < String > nonUniqueCobolNames, final Cob2XsdConfig config, final XsdDataItem parent, final int order) { StringBuilder sb = new StringBuilder(); sb.append(Character.toUpperCase(elementName.charAt(0))); sb.append(elementName.substring(1)); if (nonUniqueCobolNames.contains(cobolDataItem.getCobolName())) { if (config.nameConflictPrependParentName()) { if (parent != null) { sb.insert(0, parent.getXsdTypeName()); } } else { sb.append(cobolDataItem.getSrceLine()); } } return sb.toString(); } XsdDataItem(final CobolDataItem cobolDataItem,
            final Cob2XsdConfig config, final XsdDataItem parent,
            final int order, final List < String > nonUniqueCobolNames,
            final RecognizerErrorHandler errorHandler); boolean markODOObjectInAncestor(final String odoObjectCobolName); boolean markODOObjectInChildren(final String odoObjectCobolName,
            final String stopChildCobolName); void updateRedefinition(final String cobolName); static String formatElementName(final CobolDataItem cobolDataItem,
            final List < String > nonUniqueCobolNames,
            final Cob2XsdConfig config, final XsdDataItem parent,
            final int order); static String formatTypeName(final String elementName,
            final CobolDataItem cobolDataItem,
            final List < String > nonUniqueCobolNames,
            final Cob2XsdConfig config, final XsdDataItem parent,
            final int order); static String getXmlCompatibleCobolName(final String cobolName); XsdType getXsdType(); CobolTypes getCobolType(); int getLength(); String getPattern(); int getTotalDigits(); int getFractionDigits(); String getXsdElementName(); String getXsdTypeName(); List < XsdDataItem > getChildren(); int getMinOccurs(); int getCobolMinOccurs(); int getMaxOccurs(); int getCobolMaxOccurs(); int getLevelNumber(); String getCobolName(); String getPicture(); Usage getUsage(); String getUsageForCobol(); boolean isJustifiedRight(); boolean isSign(); boolean isSignLeading(); boolean isSignSeparate(); String getDependingOn(); boolean isSigned(); String getRedefines(); String getValue(); int getSrceLine(); DataEntryType getDataEntryType(); List < String > getConditionLiterals(); List < Range > getConditionRanges(); boolean isBlankWhenZero(); XsdDataItem getParent(); boolean isODOObject(); boolean isRedefined(); void setIsODOObject(final boolean isODOObject); void setIsRedefined(final boolean isRedefined); int getMinStorageLength(); int getMaxStorageLength(); boolean isNumeric(); List < CobolDataItem > getCobolChildren(); String toString(); }
XsdDataItem { public static String formatTypeName(final String elementName, final CobolDataItem cobolDataItem, final List < String > nonUniqueCobolNames, final Cob2XsdConfig config, final XsdDataItem parent, final int order) { StringBuilder sb = new StringBuilder(); sb.append(Character.toUpperCase(elementName.charAt(0))); sb.append(elementName.substring(1)); if (nonUniqueCobolNames.contains(cobolDataItem.getCobolName())) { if (config.nameConflictPrependParentName()) { if (parent != null) { sb.insert(0, parent.getXsdTypeName()); } } else { sb.append(cobolDataItem.getSrceLine()); } } return sb.toString(); } XsdDataItem(final CobolDataItem cobolDataItem,
            final Cob2XsdConfig config, final XsdDataItem parent,
            final int order, final List < String > nonUniqueCobolNames,
            final RecognizerErrorHandler errorHandler); boolean markODOObjectInAncestor(final String odoObjectCobolName); boolean markODOObjectInChildren(final String odoObjectCobolName,
            final String stopChildCobolName); void updateRedefinition(final String cobolName); static String formatElementName(final CobolDataItem cobolDataItem,
            final List < String > nonUniqueCobolNames,
            final Cob2XsdConfig config, final XsdDataItem parent,
            final int order); static String formatTypeName(final String elementName,
            final CobolDataItem cobolDataItem,
            final List < String > nonUniqueCobolNames,
            final Cob2XsdConfig config, final XsdDataItem parent,
            final int order); static String getXmlCompatibleCobolName(final String cobolName); XsdType getXsdType(); CobolTypes getCobolType(); int getLength(); String getPattern(); int getTotalDigits(); int getFractionDigits(); String getXsdElementName(); String getXsdTypeName(); List < XsdDataItem > getChildren(); int getMinOccurs(); int getCobolMinOccurs(); int getMaxOccurs(); int getCobolMaxOccurs(); int getLevelNumber(); String getCobolName(); String getPicture(); Usage getUsage(); String getUsageForCobol(); boolean isJustifiedRight(); boolean isSign(); boolean isSignLeading(); boolean isSignSeparate(); String getDependingOn(); boolean isSigned(); String getRedefines(); String getValue(); int getSrceLine(); DataEntryType getDataEntryType(); List < String > getConditionLiterals(); List < Range > getConditionRanges(); boolean isBlankWhenZero(); XsdDataItem getParent(); boolean isODOObject(); boolean isRedefined(); void setIsODOObject(final boolean isODOObject); void setIsRedefined(final boolean isRedefined); int getMinStorageLength(); int getMaxStorageLength(); boolean isNumeric(); List < CobolDataItem > getCobolChildren(); String toString(); static final String SAFE_NAME_PREFIX; }