예제 #1
0
        public static IEnumerable <string> PropertyImportsForInterface(PropertyJvaf property, string package)
        {
            foreach (string import in property.Imports)
            {
                if (import.StartsWith(package) && !import.Contains(".implementation."))
                {
                    continue;
                }
                yield return(import);
            }
            //
            string modelTypeName = property.ModelTypeName;

            if (property.ModelType is SequenceTypeJva)
            {
                var modelType = property.ModelType;
                while (modelType is SequenceTypeJva)
                {
                    SequenceTypeJva sequenceType = (SequenceTypeJva)modelType;
                    modelType = sequenceType.ElementType;
                }
                modelTypeName = modelType.ClassName;
            }
            //
            if (modelTypeName.EndsWith("Inner"))
            {
                yield return($"{package}.implementation.{modelTypeName}");
            }
        }
예제 #2
0
        public static HashSet <string> PropertyImports(PropertyJvaf property, string innerModelPackage)
        {
            HashSet <string> imports = new HashSet <string>();
            var propertyImports      = property.Imports;
            // var propertyImports = property.Imports.Where(import => !import.EqualsIgnoreCase(thisPackage));
            //
            string modelTypeName = property.ModelTypeName;

            if (property.ModelType is SequenceTypeJva)
            {
                var modelType = property.ModelType;
                while (modelType is SequenceTypeJva)
                {
                    SequenceTypeJva sequenceType = (SequenceTypeJva)modelType;
                    modelType = sequenceType.ElementType;
                }
                modelTypeName = modelType.ClassName;
            }
            if (modelTypeName.EndsWith("Inner"))
            {
                imports.Add($"{innerModelPackage}.{modelTypeName}");
            }
            imports.AddRange(propertyImports);
            return(imports);
        }
예제 #3
0
 public static IEnumerable <string> PropertyImportsForImpl(PropertyJvaf property, string package)
 {
     foreach (string import in property.Imports)
     {
         if (import.StartsWith(package) && import.Contains(".implementation."))
         {
             continue;
         }
         yield return(import);
     }
 }