示例#1
0
        public JavaPackage(string name, JavaPackage parent = null) : base(parent, name, JavaPackageElementTypes.Package)
        {
            Packages = new JavaPackageCollection();

            Classes   = new ClassFileCollection();
            Resources = new JavaPackageResourceCollection();
        }
示例#2
0
        static IEnumerable <JavaPackage> EnumeratePackages(JavaPackage package)
        {
            foreach (var f in package.Packages)
            {
                yield return(f);
            }

            yield return(package);
        }
示例#3
0
        protected JavaPackageElement(JavaPackage parent, string name, JavaPackageElementTypes type)
        {
            Parent = parent;
            Name   = name;

            Type = type;

            Extension = Type.GetExtension();
        }
示例#4
0
        static IEnumerable <JavaPackageResource> EnumerateResources(JavaPackage package)
        {
            foreach (var r in package.Resources)
            {
                yield return(r);
            }

            foreach (var f in package.Packages)
            {
                foreach (var r in EnumerateResources(f))
                {
                    yield return(r);
                }
            }
        }
示例#5
0
        static IEnumerable <ClassFile> EnumerateClasses(JavaPackage package)
        {
            foreach (var c in package.Classes)
            {
                yield return(c);
            }

            foreach (var f in package.Packages)
            {
                foreach (var c in EnumerateClasses(f))
                {
                    yield return(c);
                }
            }
        }
示例#6
0
        public JavaPackageResource(string name, JavaPackage parent, Stream resStream, string extension) : base(parent, name, JavaPackageElementTypes.Other)
        {
            Extension = extension;

            Content = resStream.ReadAllBytes();
        }