public JavaPackage(string name, JavaPackage parent = null) : base(parent, name, JavaPackageElementTypes.Package) { Packages = new JavaPackageCollection(); Classes = new ClassFileCollection(); Resources = new JavaPackageResourceCollection(); }
static IEnumerable <JavaPackage> EnumeratePackages(JavaPackage package) { foreach (var f in package.Packages) { yield return(f); } yield return(package); }
protected JavaPackageElement(JavaPackage parent, string name, JavaPackageElementTypes type) { Parent = parent; Name = name; Type = type; Extension = Type.GetExtension(); }
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); } } }
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); } } }
public JavaPackageResource(string name, JavaPackage parent, Stream resStream, string extension) : base(parent, name, JavaPackageElementTypes.Other) { Extension = extension; Content = resStream.ReadAllBytes(); }