
pl.chilldev.web.spring.model.Script Maven / Gradle / Ivy
/**
* This file is part of the ChillDev-Web.
*
* @license http://mit-license.org/ The MIT license
* @copyright 2014 - 2015 © by Rafał Wrzeszcz - Wrzasq.pl.
*/
package pl.chilldev.web.spring.model;
import java.nio.charset.Charset;
import pl.chilldev.web.core.script.Element;
/**
* `<script>` element properties.
*/
public class Script
{
/**
* Script location.
*/
private String src;
/**
* MIME type.
*/
private String type;
/**
* Loading flow.
*/
private Element.Flow flow;
/**
* Content charset.
*/
private Charset charset;
/**
* Initializes properties.
*
* @param src Script location.
* @param type MIME type.
* @param flow Loading flow.
* @param charset Charset.
*/
public Script(String src, String type, String flow, String charset)
{
this.src = src;
this.type = type;
this.flow = flow == null ? Element.Flow.DEFAULT : Element.Flow.valueOf(flow);
this.charset = charset == null ? null : Charset.forName(charset);
}
/**
* Returns script location.
*
* @return Script location.
*/
public String getSrc()
{
return this.src;
}
/**
* Returns script content type.
*
* @return MIME type.
*/
public String getType()
{
return this.type;
}
/**
* Returns loading flow.
*
* @return Loading flow.
*/
public Element.Flow getFlow()
{
return this.flow;
}
/**
* Returns script content charset.
*
* @return Charset.
*/
public Charset getCharset()
{
return this.charset;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy