25
26 package javafx.css.converter;
27
28 import javafx.application.Application;
29 import javafx.css.ParsedValue;
30 import javafx.css.StyleConverter;
31 import javafx.scene.text.Font;
32 import sun.util.logging.PlatformLogger;
33
34 import java.net.MalformedURLException;
35 import java.net.URI;
36 import java.net.URISyntaxException;
37 import java.net.URL;
38 import java.security.AccessController;
39 import java.security.CodeSource;
40 import java.security.PrivilegedActionException;
41 import java.security.PrivilegedExceptionAction;
42 import java.security.ProtectionDomain;
43
44 /**
45 * Convert url("<path>") a URL string resolved relative to the location of the stylesheet.
46 *
47 * @since 9
48 */
49 public final class URLConverter extends StyleConverter<ParsedValue[], String> {
50
51 // lazy, thread-safe instatiation
52 private static class Holder {
53 static final URLConverter INSTANCE = new URLConverter();
54 static final SequenceConverter SEQUENCE_INSTANCE = new SequenceConverter();
55 }
56
57 public static StyleConverter<ParsedValue[], String> getInstance() {
58 return Holder.INSTANCE;
59 }
60
61 private URLConverter() {
62 super();
63 }
64
65 @Override
|
25
26 package javafx.css.converter;
27
28 import javafx.application.Application;
29 import javafx.css.ParsedValue;
30 import javafx.css.StyleConverter;
31 import javafx.scene.text.Font;
32 import sun.util.logging.PlatformLogger;
33
34 import java.net.MalformedURLException;
35 import java.net.URI;
36 import java.net.URISyntaxException;
37 import java.net.URL;
38 import java.security.AccessController;
39 import java.security.CodeSource;
40 import java.security.PrivilegedActionException;
41 import java.security.PrivilegedExceptionAction;
42 import java.security.ProtectionDomain;
43
44 /**
45 * Converts a parsed value representing URL to a URL string that is
46 * resolved relative to the location of the stylesheet.
47 * The input value is in the form: {@code url("<path>")}.
48 *
49 * @since 9
50 */
51 public final class URLConverter extends StyleConverter<ParsedValue[], String> {
52
53 // lazy, thread-safe instatiation
54 private static class Holder {
55 static final URLConverter INSTANCE = new URLConverter();
56 static final SequenceConverter SEQUENCE_INSTANCE = new SequenceConverter();
57 }
58
59 public static StyleConverter<ParsedValue[], String> getInstance() {
60 return Holder.INSTANCE;
61 }
62
63 private URLConverter() {
64 super();
65 }
66
67 @Override
|