-
- All Implemented Interfaces:
-
io.github.asperan.mimeinfo.context.Context
public final class MimeTypeContext implements Context<MimeTypeSpecs>
The context of MimeTypes.
-
-
Field Summary
Fields Modifier and Type Field Description private BooleanglobDeleteAllprivate BooleanmagicDeleteAll
-
Constructor Summary
Constructors Constructor Description MimeTypeContext(MimeTypeSpecs.Type.MimeClass typeClass, String typeName)
-
Method Summary
Modifier and Type Method Description final BooleangetGlobDeleteAll()Whether to add the "glob delete all" element to the mime type. final UnitsetGlobDeleteAll(Boolean globDeleteAll)final BooleangetMagicDeleteAll()Whether to add the "magic delete all" to the mime type. final UnitsetMagicDeleteAll(Boolean magicDeleteAll)final Unitglob(String pattern, UByte weight)Add a glob object to the MimeType. final Unitcomment(String value, String xmlLang)Add a comment element to the MimeType. final MimeTypeSpecs.Buildermagic(Function1<MimeMagicContext, Unit> configuration)Add a magic element to the MimeType. final Unitalias(String type)Add an alias to the mimetype. final UnitsubclassOf(String type)Add a super class to the mimetype. final Unitacronym(String value, String xmlLang)Add an acronym to the mimetype. final UnitexpandedAcronym(String value, String xmlLang)Add an expanded acronym to the mimetype. final Uniticon(String name)Set the icon for the mimetype. final UnitgenericIcon(String name)Set the generic icon for the mimetype. final UnitrootXml(String namespaceUri, String localName)Set the root XML for the mimetype. final MimeTypeSpecs.Buildertreemagic(Function1<MimeTreeMagicContext, Unit> configuration)Add a treemagic to the mimetype. MimeTypeSpecsbuild()Build the object of the context. -
-
Constructor Detail
-
MimeTypeContext
MimeTypeContext(MimeTypeSpecs.Type.MimeClass typeClass, String typeName)
- Parameters:
typeClass- The class of the Mime type.typeName- The name of the type.
-
-
Method Detail
-
getGlobDeleteAll
final Boolean getGlobDeleteAll()
Whether to add the "glob delete all" element to the mime type.
-
setGlobDeleteAll
final Unit setGlobDeleteAll(Boolean globDeleteAll)
-
getMagicDeleteAll
final Boolean getMagicDeleteAll()
Whether to add the "magic delete all" to the mime type.
-
setMagicDeleteAll
final Unit setMagicDeleteAll(Boolean magicDeleteAll)
-
glob
final Unit glob(String pattern, UByte weight)
Add a glob object to the MimeType.
- Parameters:
pattern- The pattern of the glob.weight- The weight of the glob.
-
comment
final Unit comment(String value, String xmlLang)
Add a comment element to the MimeType.
- Parameters:
value- The comment.xmlLang- The xml language specification.
-
magic
final MimeTypeSpecs.Builder magic(Function1<MimeMagicContext, Unit> configuration)
Add a magic element to the MimeType.
- Parameters:
configuration- The configuration of the Magic element.
-
alias
final Unit alias(String type)
Add an alias to the mimetype.
- Parameters:
type- the type alias.
-
subclassOf
final Unit subclassOf(String type)
Add a super class to the mimetype.
- Parameters:
type- The parent type.
-
acronym
final Unit acronym(String value, String xmlLang)
Add an acronym to the mimetype.
- Parameters:
value- The value of the acronym.xmlLang- The xml language specification.
-
expandedAcronym
final Unit expandedAcronym(String value, String xmlLang)
Add an expanded acronym to the mimetype.
- Parameters:
value- The value of the expanded acronym.xmlLang- The xml language specification.
-
icon
final Unit icon(String name)
Set the icon for the mimetype.
- Parameters:
name- The name of the icon.
-
genericIcon
final Unit genericIcon(String name)
Set the generic icon for the mimetype.
- Parameters:
name- The name of the generic icon.
-
rootXml
final Unit rootXml(String namespaceUri, String localName)
Set the root XML for the mimetype.
- Parameters:
namespaceUri- The namespace URI of the root XML.localName- The localname of the root XML.
-
treemagic
final MimeTypeSpecs.Builder treemagic(Function1<MimeTreeMagicContext, Unit> configuration)
Add a treemagic to the mimetype.
- Parameters:
configuration- The configuration of the tree magic.
-
build
MimeTypeSpecs build()
Build the object of the context.
-
-
-
-