Register a ZipExtraField implementation.

<p>
The given class must have a no-arg constructor and implement the {@link ZipExtraField ZipExtraField interface}.
</p>

@param c the class to register

@since 1.1
434458
public static void register(Class<?> c) {
    try {
      ZipExtraField ze = (ZipExtraField) c.newInstance();
      implementations.put(ze.getHeaderId(), c);
    }
    catch (ClassCastException cc) {
      throw new RuntimeException(c + " doesn\'t implement ZipExtraField");
    }
    catch (InstantiationException ie) {
      throw new RuntimeException(c + " is not a concrete class");
    }
    catch (IllegalAccessException ie) {
      throw new RuntimeException(c + "\'s no-arg constructor is not public");
    }
  }
322605
@SuppressWarnings("resource")
    public static <R> Stream<R> zip(final Collection<? extends ByteStream> c, final ByteNFunction<R> zipFunction) {
        if (N.isNullOrEmpty(c)) {
            return Stream.empty();
        }

        final int len = c.size();
        final ByteIterator[] iters = new ByteIterator[len];
        int i = 0;

        for (ByteStream s : c) {
            iters[i++] = s.iteratorEx();
        }

        return new IteratorStream<>(new ObjIteratorEx<R>() {
            @Override
            public boolean hasNext() {
                for (int i = 0; i < len; i++) {
                    if (iters[i].hasNext() == false) {
                        return false;
                    }
                }

                return true;
            }

            @Override
            public R next() {
                final byte[] args = new byte[len];

                for (int i = 0; i < len; i++) {
                    args[i] = iters[i].nextByte();
                }

                return zipFunction.apply(args);
            }
        }).onClose(newCloseHandler(c));
    }
262328
@SuppressWarnings("resource")
    public static <R> Stream<R> zip(final Collection<? extends CharStream> c, final CharNFunction<R> zipFunction) {
        if (N.isNullOrEmpty(c)) {
            return Stream.empty();
        }

        final int len = c.size();
        final CharIterator[] iters = new CharIterator[len];
        int i = 0;

        for (CharStream s : c) {
            iters[i++] = s.iteratorEx();
        }

        return new IteratorStream<>(new ObjIteratorEx<R>() {
            @Override
            public boolean hasNext() {
                for (int i = 0; i < len; i++) {
                    if (iters[i].hasNext() == false) {
                        return false;
                    }
                }

                return true;
            }

            @Override
            public R next() {
                final char[] args = new char[len];

                for (int i = 0; i < len; i++) {
                    args[i] = iters[i].nextChar();
                }

                return zipFunction.apply(args);
            }
        }).onClose(newCloseHandler(c));
    }
191842
public void registerExtension(ExtensionNamespaceSupport extNsSpt)
  {
    String namespace = extNsSpt.getNamespace();
    if (namespaceIndex(namespace, m_extensions) == -1)
    {
      m_extensions.add(extNsSpt);
      if (m_unregisteredExtensions.contains(namespace))
        m_unregisteredExtensions.remove(namespace);
    }
    
  }
699071
public void register(String simpleName, Class<? extends T> clazz) {
        this.constructors.put(simpleName, clazz);
    }
309171
public boolean add(SatConstraintBuilder c) {
        if (this.builders.containsKey(c.getIdentifier())) {
            return false;
        }
        this.builders.put(c.getIdentifier(), c);
        return true;
    }
1225177
@VisibleForTesting
  static void register(SpanExporter spanExporter, Handler handler) {
    ZipkinTraceExporter.register(spanExporter, handler);
  }
544501
@SuppressWarnings("resource")
    public static <R> Stream<R> zip(final Collection<? extends LongStream> c, final LongNFunction<R> zipFunction) {
        if (N.isNullOrEmpty(c)) {
            return Stream.empty();
        }

        final int len = c.size();
        final LongIterator[] iters = new LongIterator[len];
        int i = 0;

        for (LongStream s : c) {
            iters[i++] = s.iteratorEx();
        }

        return new IteratorStream<>(new ObjIteratorEx<R>() {
            @Override
            public boolean hasNext() {
                for (int i = 0; i < len; i++) {
                    if (iters[i].hasNext() == false) {
                        return false;
                    }
                }

                return true;
            }

            @Override
            public R next() {
                final long[] args = new long[len];

                for (int i = 0; i < len; i++) {
                    args[i] = iters[i].nextLong();
                }

                return zipFunction.apply(args);
            }
        }).onClose(newCloseHandler(c));
    }
1279601
public void register(Compressor c) {
    String encoding = c.getMessageEncoding();
    checkArgument(!encoding.contains(","), "Comma is currently not allowed in message encoding");
    compressors.put(encoding, c);
  }
1331542
public void register(Context context) {
        if (mRegisteredContext != null) {
            throw new IllegalStateException("Already registered");
        }

        mRegisteredContext = context;
        context.registerReceiver(this, mPackageFilter);
    }
576725
@Override
    protected void zipFile(InputStream is, ZipOutputStream zOut, String vPath,
            long lastModified, File fromArchive, int mode) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        IoUtil.copy(is, baos, buf);
        struct.data = baos.toByteArray();
        struct.name = vPath;
        struct.time = lastModified;
        if (proc.process(struct) != JarProcessor.Result.DISCARD) {
            if (mode == 0)
                mode = ZipFileSet.DEFAULT_FILE_MODE;
            if (!filesOnly) {
                addParentDirs(struct.name, zOut);
            }
            super.zipFile(new ByteArrayInputStream(struct.data),
                    zOut, struct.name, struct.time, fromArchive, mode);
        }
    }
777800
private List<Field> allFields(final Class<?> c) {
        List<Field> l = this.fieldsCache.get(c);
        if (l == null) {
            l = new LinkedList<Field>();
            final Field[] fields = c.getDeclaredFields();
            addAll(l, fields);
            Class<?> sc = c;
            while (((sc = sc.getSuperclass()) != Object.class) && (sc != null)) {
                addAll(l, sc.getDeclaredFields());
            }
            this.fieldsCache.putIfAbsent(c, l);
        }
        return l;
    }
1235446
public FileObject write(ClassSymbol c)
        throws IOException
    {
        String className = c.flatName().toString();
        FileObject outFile
            = fileManager.getFileForOutput(StandardLocation.NATIVE_HEADER_OUTPUT,
                "", className.replaceAll("[.$]", "_") + ".h", null);
        Writer out = outFile.openWriter();
        try {
            write(out, c);
            if (verbose)
                log.printVerbose("wrote.file", outFile);
            out.close();
            out = null;
        } finally {
            if (out != null) {
                // if we are propogating an exception, delete the file
                out.close();
                outFile.delete();
                outFile = null;
            }
        }
        return outFile; // may be null if write failed
    }
156848
public final TextBuilder p(char c) {
        if (null != __buffer) __append(c);
        else __caller.p(c);
        return this;
    }
1027163
public void add(byte b, Collection c) {
		if ((c != null) && (c.size() > 0)) {
			String s2 = get(b);
            for (Object aC : c) {
                String s = (String) aC;
                if (s2 == null)
                    s2 = s;
                else
                    s2 += lineSeparator + s;
            }
			set(b, s2);
		}
	}
941717
private void mapFilesInZip(String fileName) {
		File file = new File(fileName);
		fileCreationTimes.put(file, new Long(file.lastModified()));

		ZipFile zipfile;
		try {
			zipfile = new ZipFile(fileName);
		} catch (IOException ioe) {
			throw new NoClassDefFoundError("class location '" + fileName + "' can not be accessed by classloader: " + ioe);
		}
		Enumeration<? extends ZipEntry> e = zipfile.entries();
		while (e.hasMoreElements()) {
			ZipEntry entry = e.nextElement();
			if (!entry.isDirectory()) {
				mapClassResourceEntry(entry.getName(), fileName);
			}
		}
		try {
			zipfile.close();
		} catch (IOException ioe) {
			throw new NoClassDefFoundError("class fileName '" + fileName + "' can not be accessed by classloader: " + ioe);
		}
	}
745151
private static void registerFromClasspath(
            String beanName, String deserName, Map<Class<?>, SerDeserializer> map) throws Exception {

        Class<? extends Bean> beanClass = Class.forName(beanName).asSubclass(Bean.class);
        Class<?> deserClass = Class.forName(deserName);

        Field field = null;
        SerDeserializer deser;
        try {
            field = deserClass.getDeclaredField("DESERIALIZER");
            if (!Modifier.isStatic(field.getModifiers())) {
                throw new IllegalStateException("Field " + field + " must be static");
            }
            deser = SerDeserializer.class.cast(field.get(null));
        } catch (NoSuchFieldException ex) {
            Constructor<?> cons = null;
            try {
                cons = deserClass.getConstructor();
                deser = SerDeserializer.class.cast(cons.newInstance());
            } catch (NoSuchMethodException ex2) {
                throw new IllegalStateException(
                        "Class " + deserClass.getName() + " must have field DESERIALIZER or a no-arg constructor");
            } catch (IllegalAccessException ex2) {
                cons.setAccessible(true);
                deser = SerDeserializer.class.cast(cons.newInstance());
            }
        } catch (IllegalAccessException ex) {
            field.setAccessible(true);
            deser = SerDeserializer.class.cast(field.get(null));
        }
        map.put(beanClass, deser);
    }