Exemplo n.º 1
0
 public static final Type.List For(Set<Kind> kinds) {
   Kind[] kindsSet = new Kind[kinds.size()];
   kindsSet = kinds.toArray(kindsSet);
   Type.List list = new Type.List();
   for (int cc = 0, count = kindsSet.length; cc < count; cc++) {
     Kind kind = kindsSet[cc];
     if (Kind.SOURCE == kind) list.add(Type.Tools.Of("java"));
     else if (Kind.CLASS == kind) list.add(Type.Tools.Of("class"));
     else if (Kind.HTML == kind) list.add(Type.Tools.Of("html"));
   }
   return list;
 }
Exemplo n.º 2
0
    /** Boostrap and validate type and rtype instances in the file cache. */
    public Tools init() {
      /*
       * Install
       */
      alto.lang.Type[] types = this.bootstrap();
      /*
       * Validate
       */
      alto.lang.Type test;

      for (alto.lang.Type type : types) {

        String name = type.getName();
        test = Type.Tools.For(name);
        if (type != test && (!type.equals(test))) throw new alto.sys.Error.Bug(name + '@' + type);

        String fext = type.getFext();
        test = Type.Tools.Of(fext);
        if (type != test && (!type.equals(test))) throw new alto.sys.Error.Bug(fext + '@' + type);
      }
      return this;
    }
Exemplo n.º 3
0
 public static final alto.lang.Type Nil() {
   return alto.lang.Type.Tools.For(Component.Type.Instances.Nil);
 }
Exemplo n.º 4
0
 public static final alto.lang.Type Config() {
   return alto.lang.Type.Tools.For(Component.Type.Instances.Config);
 }
Exemplo n.º 5
0
 public static final alto.lang.Type Sio() {
   return alto.lang.Type.Tools.For(Component.Type.Instances.Sio);
 }
Exemplo n.º 6
0
 public static final alto.lang.Type Keys() {
   return alto.lang.Type.Tools.For(Component.Type.Instances.Keys);
 }
Exemplo n.º 7
0
 public static final alto.lang.Type Address() {
   return alto.lang.Type.Tools.For(Component.Type.Instances.Address);
 }
Exemplo n.º 8
0
 public static final alto.lang.Type MimeType() {
   return alto.lang.Type.Tools.For(Component.Type.Instances.MimeType);
 }
Exemplo n.º 9
0
 public Default() {
   super();
   this.add(Type.Tools.Of("txt"));
   this.add(Type.Tools.Of("html"));
   this.add(Type.Tools.Of("xml"));
   this.add(Type.Tools.Of("java"));
   this.add(Type.Tools.Of("sp"));
   this.add(Type.Tools.Of("properties"));
   this.add(Type.Tools.Of("jpg"));
   this.add(Type.Tools.Of("png"));
   this.add(Type.Tools.Of("gif"));
   this.add(Type.Tools.Of("jar"));
   this.add(Type.Tools.Of("sh"));
   this.add(Type.Tools.Of("js"));
   this.add(Type.Tools.Of("css"));
   this.add(Type.Tools.Of("jnlp"));
 }