コード例 #1
0
 public override bool Transform(AliasDefine node)
 {
     if (node.Order == AliasDefine.OrderType.Column)
     {
         string tmpVal = node.Value;
         node.Value  = CaseFormatUtils.Convert(_entity.ReservedWordCase, "AS");
         node.Value += _entity.BeforeAliasDefineWhiteSpace;
         node.Value += tmpVal;
     }
     return(base.Transform(node));
 }
コード例 #2
0
 public override bool Transform(TableOrColumnName node)
 {
     if (node.Order == TableOrColumnName.OrderType.Table)
     {
         node.Value = CaseFormatUtils.Convert(_entity.ColumnNameCase, node.Value);
     }
     else if (node.Order == TableOrColumnName.OrderType.Column)
     {
         node.Value = CaseFormatUtils.Convert(_entity.TableNameCase, node.Value);
     }
     return(base.Transform(node));
 }
コード例 #3
0
        /// <summary>
        /// To<br />
        /// 转换
        /// </summary>
        /// <param name="style"></param>
        /// <param name="sequence"></param>
        /// <returns></returns>
        public string To(Style style, string sequence)
        {
            var     list = _splitter.SplitToList(sequence);
            IJoiner joiner;

            switch (style)
            {
            case Style.LOWER_CAMEL:
            {
                CaseFormatUtils.LowerCase(list);
                CaseFormatUtils.UpperCaseEachFirstChar(list);
                CaseFormatUtils.LowerCaseFirstItemFirstChar(list);
                joiner = Joiner.On("");
                break;
            }

            case Style.LOWER_HYPHEN:
            {
                CaseFormatUtils.LowerCase(list);
                joiner = Joiner.On("-");
                break;
            }

            case Style.LOWER_UNDERSCORE:
            {
                CaseFormatUtils.LowerCase(list);
                joiner = Joiner.On("_");
                break;
            }

            case Style.UPPER_CAMEL:
            {
                CaseFormatUtils.LowerCase(list);
                CaseFormatUtils.UpperCaseEachFirstChar(list);
                joiner = Joiner.On("");
                break;
            }

            case Style.UPPER_UNDERSCORE:
            {
                CaseFormatUtils.UpperCase(list);
                joiner = Joiner.On("_");
                break;
            }

            default:
                throw new InvalidOperationException("Invalid operation.");
            }

            return(joiner.Join(list));
        }
コード例 #4
0
 public override bool Transform(Statement node)
 {
     node.Value = CaseFormatUtils.Convert(_entity.StatementSeparatorCase, node.Value);
     return(base.Transform(node));
 }
コード例 #5
0
 public override bool Transform(ReservedTopLevel node)
 {
     node.Value = CaseFormatUtils.Convert(_entity.TopReservedWordCase, node.Value);
     return(base.Transform(node));
 }
コード例 #6
0
 public override bool Transform(AliasDefine node)
 {
     node.Value = CaseFormatUtils.Convert(_entity.AliasNameCase, node.Value);
     return(base.Transform(node));
 }