Class CoderMetadataSet<T,M extends CoderMetadata<T>>
- java.lang.Object
-
- org.eclipse.jetty.websocket.jsr356.metadata.CoderMetadataSet<T,M>
-
- Type Parameters:
T
- The type of coder (Decoder
orEncoder
M
- The metadata for the coder
- All Implemented Interfaces:
java.lang.Iterable<M>
- Direct Known Subclasses:
DecoderMetadataSet
,EncoderMetadataSet
public abstract class CoderMetadataSet<T,M extends CoderMetadata<T>> extends java.lang.Object implements java.lang.Iterable<M>
An durable collection ofCoderMetadata
.This is a write-only collection, and cannot be modified once initialized.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CoderMetadataSet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
add(java.lang.Class<? extends T> coder)
java.util.List<M>
addAll(java.lang.Class<? extends T>[] coders)
java.util.List<M>
addAll(java.util.List<java.lang.Class<? extends T>> coders)
protected abstract java.util.List<M>
discover(java.lang.Class<? extends T> coder)
Coder Specific discovery of Metadata for a specific coder.java.lang.Class<? extends T>
getCoder(java.lang.Class<?> type)
java.util.List<java.lang.Class<? extends T>>
getList()
java.util.List<M>
getMetadataByImplementation(java.lang.Class<? extends T> clazz)
M
getMetadataByType(java.lang.Class<?> type)
java.util.Iterator<M>
iterator()
java.lang.String
toString()
protected void
trackMetadata(java.util.List<M> metadatas)
protected void
trackMetadata(M metadata)
-
-
-
Method Detail
-
add
public void add(java.lang.Class<? extends T> coder)
-
discover
protected abstract java.util.List<M> discover(java.lang.Class<? extends T> coder)
Coder Specific discovery of Metadata for a specific coder.- Parameters:
coder
- the coder to discover metadata in.- Returns:
- the list of metadata discovered
- Throws:
InvalidWebSocketException
- if unable to discover some metadata. Sucha as: a duplicateCoderMetadata.getObjectType()
encountered, , or if unable to find the concrete generic class reference for the coder, or if the provided coder is not valid per spec.
-
getCoder
public java.lang.Class<? extends T> getCoder(java.lang.Class<?> type)
-
getList
public java.util.List<java.lang.Class<? extends T>> getList()
-
getMetadataByImplementation
public java.util.List<M> getMetadataByImplementation(java.lang.Class<? extends T> clazz)
-
getMetadataByType
public M getMetadataByType(java.lang.Class<?> type)
-
iterator
public java.util.Iterator<M> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<T>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
trackMetadata
protected void trackMetadata(java.util.List<M> metadatas)
-
trackMetadata
protected void trackMetadata(M metadata)
-
-