Liking cljdoc? Tell your friends :D

pathological.attribute-specs


->attribute-specclj

(->attribute-spec value)

Converts the provided attribute spec string to a normalised attribute spec, a map with keys :view and :name for a single attribute or :view and :names for multiple attributes, with keyword values representing the corresponding attribute(s).

Multiple formats for the attribute spec string are supported:

  • "attribute-view:attribute-name"
  • "attribute-view:attribute-1-name,attribute-2-name"
  • "attribute-name"
  • "attribute-1-name,attribute-2-name"

In the case that no attribute view is provided, :basic is inferred. Attribute view and name(s) can be provided in camel case or kebab case and will always be converted to kebab cased keywords.

The attribute view or name can also be the wildcard "*" representing all views or names respectively. Wildcard attribute specs are used for attribute conversions. See pathological.utils/->attribute-value and pathological.utils/<-attribute-value for more details.

If the provided value is already a map, it is returned unaltered.

Converts the provided attribute spec string to a normalised attribute
spec, a map with keys `:view` and `:name` for a single attribute or
`:view` and `:names` for multiple attributes, with keyword values representing
the corresponding attribute(s).

Multiple formats for the attribute spec string are supported:

  - `"attribute-view:attribute-name"`
  - `"attribute-view:attribute-1-name,attribute-2-name"`
  - `"attribute-name"`
  - `"attribute-1-name,attribute-2-name"`

In the case that no attribute view is provided, `:basic` is inferred.
Attribute view and name(s) can be provided in camel case or kebab case and
will always be converted to kebab cased keywords.

The attribute view or name can also be the wildcard `"*"` representing all
views or names respectively. Wildcard attribute specs are used for attribute
conversions. See [[pathological.utils/->attribute-value]] and
[[pathological.utils/<-attribute-value]] for more details.

If the provided value is already a map, it is returned unaltered.
sourceraw docstring

->attribute-spec-stringclj

(->attribute-spec-string value)

Converts the provided attribute spec or attribute spec string to the correct format to be passed to the underlying Java methods acting on file attributes. Provided attribute specs can be for a single attribute or for multiple attributes and can include wildcards. In the case that no attribute view is provided, :basic is inferred.

Converts the provided attribute spec or attribute spec string to the correct
format to be passed to the underlying Java methods acting on file attributes.
Provided attribute specs can be for a single attribute or for
multiple attributes and can include wildcards. In the case that no
attribute view is provided, `:basic` is inferred.
sourceraw docstring

nameclj

(name attribute-spec)

Returns the name, as a keyword, from the provided single attribute attribute spec or attribute spec string. If the attribute spec is for multiple attributes, nil is returned.

Returns the name, as a keyword, from the provided single attribute attribute
spec or attribute spec string. If the attribute spec is for multiple
attributes, `nil` is returned.
sourceraw docstring

name?clj

(name? attribute-spec name-or-names)

Checks if the provided attribute spec is for a single attribute with name in any of the provided names. The second argument can be either a single name or a collection of names. Either nil or the matching name is returned.

Checks if the provided attribute spec is for a single attribute with name
in any of the provided names. The second argument can be either a single name
or a collection of names. Either `nil` or the matching name is returned.
sourceraw docstring

namesclj

(names attribute-spec)

Returns the names, as a set of keywords, from the provided multiple attribute attribute spec or attribute spec string. If the attribute spec is for a single attribute, nil is returned.

Returns the names, as a set of keywords, from the provided multiple attribute
attribute spec or attribute spec string. If the attribute spec is for a single
attribute, `nil` is returned.
sourceraw docstring

viewclj

(view attribute-spec)

Returns the view, as a keyword, from the provided attribute spec or attribute spec string. If no view is present, :basic is inferred.

Returns the view, as a keyword, from the provided attribute spec or
attribute spec string. If no view is present, `:basic` is inferred.
sourceraw docstring

view?clj

(view? attribute-spec view-or-views)

Checks if the provided attribute spec has any of the provided views. The second argument can be either a single view or a collection of views. If no view is present, :basic is inferred. Either nil or the matching view is returned.

Checks if the provided attribute spec has any of the provided views. The
second argument can be either a single view or a collection of views. If no
view is present, `:basic` is inferred. Either `nil` or the matching view is
returned.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close