Class HostSourceDirective
- java.lang.Object
-
- com.shapesecurity.salvation2.Directive
-
- com.shapesecurity.salvation2.Directives.HostSourceDirective
-
- Direct Known Subclasses:
FrameAncestorsDirective
,SourceExpressionDirective
public abstract class HostSourceDirective extends Directive
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.shapesecurity.salvation2.Directive
Directive.DirectiveErrorConsumer, Directive.ManipulationErrorConsumer
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<Host>
hosts
protected java.lang.String
none
protected java.util.List<Scheme>
schemes
protected boolean
self
protected boolean
star
-
Fields inherited from class com.shapesecurity.salvation2.Directive
containsNonDirectiveCharacter, values
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
HostSourceDirective(java.util.List<java.lang.String> values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
_addHostOrSchemeDuringConstruction(java.lang.String token, java.lang.String lowcaseToken, java.lang.String kind, int index, Directive.DirectiveErrorConsumer errors)
private boolean
_addHostSource(Host source, int index, Directive.DirectiveErrorConsumer errors)
private boolean
_addScheme(Scheme scheme, int index, Directive.DirectiveErrorConsumer errors)
void
addHost(Host host, Directive.ManipulationErrorConsumer errors)
void
addScheme(Scheme scheme, Directive.ManipulationErrorConsumer errors)
protected void
addValue(java.lang.String value)
java.util.List<Host>
getHosts()
java.util.List<Scheme>
getSchemes()
boolean
removeHost(Host host)
boolean
removeScheme(Scheme scheme)
protected void
removeValueIgnoreCase(java.lang.String value)
protected <T> void
removeValuesMatching(T value, java.util.function.Function<java.lang.String,java.util.Optional<T>> parser)
boolean
self()
void
setSelf(boolean self)
void
setStar(boolean star)
boolean
star()
-
Methods inherited from class com.shapesecurity.salvation2.Directive
getValues, wrapManipulationErrorConsumer
-
-
-
-
Method Detail
-
removeValueIgnoreCase
protected void removeValueIgnoreCase(java.lang.String value)
- Overrides:
removeValueIgnoreCase
in classDirective
-
removeValuesMatching
protected <T> void removeValuesMatching(T value, java.util.function.Function<java.lang.String,java.util.Optional<T>> parser)
-
_addHostOrSchemeDuringConstruction
void _addHostOrSchemeDuringConstruction(java.lang.String token, java.lang.String lowcaseToken, java.lang.String kind, int index, Directive.DirectiveErrorConsumer errors)
-
_addScheme
private boolean _addScheme(Scheme scheme, int index, Directive.DirectiveErrorConsumer errors)
-
_addHostSource
private boolean _addHostSource(Host source, int index, Directive.DirectiveErrorConsumer errors)
-
star
public boolean star()
-
setStar
public void setStar(boolean star)
-
self
public boolean self()
-
setSelf
public void setSelf(boolean self)
-
getSchemes
public java.util.List<Scheme> getSchemes()
-
addScheme
public void addScheme(Scheme scheme, Directive.ManipulationErrorConsumer errors)
-
removeScheme
public boolean removeScheme(Scheme scheme)
-
getHosts
public java.util.List<Host> getHosts()
-
addHost
public void addHost(Host host, Directive.ManipulationErrorConsumer errors)
-
removeHost
public boolean removeHost(Host host)
-
-