static <T> Descriptor makeDescriptor(OpenType<T> openType,
T defaultValue,
T[] legalValues,
Comparable<T> minValue,
Comparable<T> maxValue) {
Map<String, Object> map = new HashMap<String, Object>();
if (defaultValue != null)
map.put("defaultValue", defaultValue);
if (legalValues != null) {
Set<T> set = new HashSet<T>();
for (T v : legalValues)
set.add(v);
set = Collections.unmodifiableSet(set);
map.put("legalValues", set);
}
if (minValue != null)
map.put("minValue", minValue);
if (maxValue != null)
map.put("maxValue", maxValue);
if (map.isEmpty()) {
return openType.getDescriptor();
} else {
map.put("openType", openType);
return new ImmutableDescriptor(map);
}
}
java类javax.management.ImmutableDescriptor的实例源码
OpenMBeanAttributeInfoSupport.java 文件源码
项目:OpenJSharp
阅读 29
收藏 0
点赞 0
评论 0
OpenMBeanAttributeInfoSupport.java 文件源码
项目:jdk8u-jdk
阅读 26
收藏 0
点赞 0
评论 0
static <T> Descriptor makeDescriptor(OpenType<T> openType,
T defaultValue,
T[] legalValues,
Comparable<T> minValue,
Comparable<T> maxValue) {
Map<String, Object> map = new HashMap<String, Object>();
if (defaultValue != null)
map.put("defaultValue", defaultValue);
if (legalValues != null) {
Set<T> set = new HashSet<T>();
for (T v : legalValues)
set.add(v);
set = Collections.unmodifiableSet(set);
map.put("legalValues", set);
}
if (minValue != null)
map.put("minValue", minValue);
if (maxValue != null)
map.put("maxValue", maxValue);
if (map.isEmpty()) {
return openType.getDescriptor();
} else {
map.put("openType", openType);
return new ImmutableDescriptor(map);
}
}
AnnotationTest.java 文件源码
项目:jdk8u-jdk
阅读 30
收藏 0
点赞 0
评论 0
private static void check(Object x, Descriptor d, Descriptor expect) {
String fail = null;
try {
Descriptor u = ImmutableDescriptor.union(d, expect);
if (!u.equals(d))
fail = "should contain " + expect + "; is " + d;
} catch (IllegalArgumentException e) {
fail = e.getMessage();
}
if (fail == null) {
System.out.println("OK: " + x);
} else {
failed = "NOT OK: Incorrect descriptor for: " + x;
System.out.println(failed);
System.out.println("..." + fail);
}
}
OpenMBeanAttributeInfoSupport.java 文件源码
项目:openjdk-jdk10
阅读 28
收藏 0
点赞 0
评论 0
static <T> Descriptor makeDescriptor(OpenType<T> openType,
T defaultValue,
T[] legalValues,
Comparable<T> minValue,
Comparable<T> maxValue) {
Map<String, Object> map = new HashMap<String, Object>();
if (defaultValue != null)
map.put("defaultValue", defaultValue);
if (legalValues != null) {
Set<T> set = new HashSet<T>();
for (T v : legalValues)
set.add(v);
set = Collections.unmodifiableSet(set);
map.put("legalValues", set);
}
if (minValue != null)
map.put("minValue", minValue);
if (maxValue != null)
map.put("maxValue", maxValue);
if (map.isEmpty()) {
return openType.getDescriptor();
} else {
map.put("openType", openType);
return new ImmutableDescriptor(map);
}
}
AnnotationTest.java 文件源码
项目:openjdk-jdk10
阅读 29
收藏 0
点赞 0
评论 0
private static void check(Object x, Descriptor d, Descriptor expect) {
String fail = null;
try {
Descriptor u = ImmutableDescriptor.union(d, expect);
if (!u.equals(d))
fail = "should contain " + expect + "; is " + d;
} catch (IllegalArgumentException e) {
fail = e.getMessage();
}
if (fail == null) {
System.out.println("OK: " + x);
} else {
failed = "NOT OK: Incorrect descriptor for: " + x;
System.out.println(failed);
System.out.println("..." + fail);
}
}
OpenMBeanAttributeInfoSupport.java 文件源码
项目:openjdk9
阅读 31
收藏 0
点赞 0
评论 0
static <T> Descriptor makeDescriptor(OpenType<T> openType,
T defaultValue,
T[] legalValues,
Comparable<T> minValue,
Comparable<T> maxValue) {
Map<String, Object> map = new HashMap<String, Object>();
if (defaultValue != null)
map.put("defaultValue", defaultValue);
if (legalValues != null) {
Set<T> set = new HashSet<T>();
for (T v : legalValues)
set.add(v);
set = Collections.unmodifiableSet(set);
map.put("legalValues", set);
}
if (minValue != null)
map.put("minValue", minValue);
if (maxValue != null)
map.put("maxValue", maxValue);
if (map.isEmpty()) {
return openType.getDescriptor();
} else {
map.put("openType", openType);
return new ImmutableDescriptor(map);
}
}
AnnotationTest.java 文件源码
项目:openjdk9
阅读 32
收藏 0
点赞 0
评论 0
private static void check(Object x, Descriptor d, Descriptor expect) {
String fail = null;
try {
Descriptor u = ImmutableDescriptor.union(d, expect);
if (!u.equals(d))
fail = "should contain " + expect + "; is " + d;
} catch (IllegalArgumentException e) {
fail = e.getMessage();
}
if (fail == null) {
System.out.println("OK: " + x);
} else {
failed = "NOT OK: Incorrect descriptor for: " + x;
System.out.println(failed);
System.out.println("..." + fail);
}
}
OpenMBeanAttributeInfoSupport.java 文件源码
项目:Java8CN
阅读 37
收藏 0
点赞 0
评论 0
static <T> Descriptor makeDescriptor(OpenType<T> openType,
T defaultValue,
T[] legalValues,
Comparable<T> minValue,
Comparable<T> maxValue) {
Map<String, Object> map = new HashMap<String, Object>();
if (defaultValue != null)
map.put("defaultValue", defaultValue);
if (legalValues != null) {
Set<T> set = new HashSet<T>();
for (T v : legalValues)
set.add(v);
set = Collections.unmodifiableSet(set);
map.put("legalValues", set);
}
if (minValue != null)
map.put("minValue", minValue);
if (maxValue != null)
map.put("maxValue", maxValue);
if (map.isEmpty()) {
return openType.getDescriptor();
} else {
map.put("openType", openType);
return new ImmutableDescriptor(map);
}
}
OpenMBeanAttributeInfoSupport.java 文件源码
项目:jdk8u_jdk
阅读 32
收藏 0
点赞 0
评论 0
static <T> Descriptor makeDescriptor(OpenType<T> openType,
T defaultValue,
T[] legalValues,
Comparable<T> minValue,
Comparable<T> maxValue) {
Map<String, Object> map = new HashMap<String, Object>();
if (defaultValue != null)
map.put("defaultValue", defaultValue);
if (legalValues != null) {
Set<T> set = new HashSet<T>();
for (T v : legalValues)
set.add(v);
set = Collections.unmodifiableSet(set);
map.put("legalValues", set);
}
if (minValue != null)
map.put("minValue", minValue);
if (maxValue != null)
map.put("maxValue", maxValue);
if (map.isEmpty()) {
return openType.getDescriptor();
} else {
map.put("openType", openType);
return new ImmutableDescriptor(map);
}
}
AnnotationTest.java 文件源码
项目:jdk8u_jdk
阅读 38
收藏 0
点赞 0
评论 0
private static void check(Object x, Descriptor d, Descriptor expect) {
String fail = null;
try {
Descriptor u = ImmutableDescriptor.union(d, expect);
if (!u.equals(d))
fail = "should contain " + expect + "; is " + d;
} catch (IllegalArgumentException e) {
fail = e.getMessage();
}
if (fail == null) {
System.out.println("OK: " + x);
} else {
failed = "NOT OK: Incorrect descriptor for: " + x;
System.out.println(failed);
System.out.println("..." + fail);
}
}
OpenMBeanAttributeInfoSupport.java 文件源码
项目:lookaside_java-1.8.0-openjdk
阅读 29
收藏 0
点赞 0
评论 0
static <T> Descriptor makeDescriptor(OpenType<T> openType,
T defaultValue,
T[] legalValues,
Comparable<T> minValue,
Comparable<T> maxValue) {
Map<String, Object> map = new HashMap<String, Object>();
if (defaultValue != null)
map.put("defaultValue", defaultValue);
if (legalValues != null) {
Set<T> set = new HashSet<T>();
for (T v : legalValues)
set.add(v);
set = Collections.unmodifiableSet(set);
map.put("legalValues", set);
}
if (minValue != null)
map.put("minValue", minValue);
if (maxValue != null)
map.put("maxValue", maxValue);
if (map.isEmpty()) {
return openType.getDescriptor();
} else {
map.put("openType", openType);
return new ImmutableDescriptor(map);
}
}
AnnotationTest.java 文件源码
项目:lookaside_java-1.8.0-openjdk
阅读 38
收藏 0
点赞 0
评论 0
private static void check(Object x, Descriptor d, Descriptor expect) {
String fail = null;
try {
Descriptor u = ImmutableDescriptor.union(d, expect);
if (!u.equals(d))
fail = "should contain " + expect + "; is " + d;
} catch (IllegalArgumentException e) {
fail = e.getMessage();
}
if (fail == null) {
System.out.println("OK: " + x);
} else {
failed = "NOT OK: Incorrect descriptor for: " + x;
System.out.println(failed);
System.out.println("..." + fail);
}
}
OpenMBeanAttributeInfoSupport.java 文件源码
项目:infobip-open-jdk-8
阅读 48
收藏 0
点赞 0
评论 0
static <T> Descriptor makeDescriptor(OpenType<T> openType,
T defaultValue,
T[] legalValues,
Comparable<T> minValue,
Comparable<T> maxValue) {
Map<String, Object> map = new HashMap<String, Object>();
if (defaultValue != null)
map.put("defaultValue", defaultValue);
if (legalValues != null) {
Set<T> set = new HashSet<T>();
for (T v : legalValues)
set.add(v);
set = Collections.unmodifiableSet(set);
map.put("legalValues", set);
}
if (minValue != null)
map.put("minValue", minValue);
if (maxValue != null)
map.put("maxValue", maxValue);
if (map.isEmpty()) {
return openType.getDescriptor();
} else {
map.put("openType", openType);
return new ImmutableDescriptor(map);
}
}
AnnotationTest.java 文件源码
项目:infobip-open-jdk-8
阅读 27
收藏 0
点赞 0
评论 0
private static void check(Object x, Descriptor d, Descriptor expect) {
String fail = null;
try {
Descriptor u = ImmutableDescriptor.union(d, expect);
if (!u.equals(d))
fail = "should contain " + expect + "; is " + d;
} catch (IllegalArgumentException e) {
fail = e.getMessage();
}
if (fail == null) {
System.out.println("OK: " + x);
} else {
failed = "NOT OK: Incorrect descriptor for: " + x;
System.out.println(failed);
System.out.println("..." + fail);
}
}
OpenMBeanAttributeInfoSupport.java 文件源码
项目:jdk8u-dev-jdk
阅读 26
收藏 0
点赞 0
评论 0
static <T> Descriptor makeDescriptor(OpenType<T> openType,
T defaultValue,
T[] legalValues,
Comparable<T> minValue,
Comparable<T> maxValue) {
Map<String, Object> map = new HashMap<String, Object>();
if (defaultValue != null)
map.put("defaultValue", defaultValue);
if (legalValues != null) {
Set<T> set = new HashSet<T>();
for (T v : legalValues)
set.add(v);
set = Collections.unmodifiableSet(set);
map.put("legalValues", set);
}
if (minValue != null)
map.put("minValue", minValue);
if (maxValue != null)
map.put("maxValue", maxValue);
if (map.isEmpty()) {
return openType.getDescriptor();
} else {
map.put("openType", openType);
return new ImmutableDescriptor(map);
}
}
AnnotationTest.java 文件源码
项目:jdk8u-dev-jdk
阅读 36
收藏 0
点赞 0
评论 0
private static void check(Object x, Descriptor d, Descriptor expect) {
String fail = null;
try {
Descriptor u = ImmutableDescriptor.union(d, expect);
if (!u.equals(d))
fail = "should contain " + expect + "; is " + d;
} catch (IllegalArgumentException e) {
fail = e.getMessage();
}
if (fail == null) {
System.out.println("OK: " + x);
} else {
failed = "NOT OK: Incorrect descriptor for: " + x;
System.out.println(failed);
System.out.println("..." + fail);
}
}
OpenMBeanAttributeInfoSupport.java 文件源码
项目:jdk7-jdk
阅读 29
收藏 0
点赞 0
评论 0
static <T> Descriptor makeDescriptor(OpenType<T> openType,
T defaultValue,
T[] legalValues,
Comparable<T> minValue,
Comparable<T> maxValue) {
Map<String, Object> map = new HashMap<String, Object>();
if (defaultValue != null)
map.put("defaultValue", defaultValue);
if (legalValues != null) {
Set<T> set = new HashSet<T>();
for (T v : legalValues)
set.add(v);
set = Collections.unmodifiableSet(set);
map.put("legalValues", set);
}
if (minValue != null)
map.put("minValue", minValue);
if (maxValue != null)
map.put("maxValue", maxValue);
if (map.isEmpty()) {
return openType.getDescriptor();
} else {
map.put("openType", openType);
return new ImmutableDescriptor(map);
}
}
AnnotationTest.java 文件源码
项目:jdk7-jdk
阅读 32
收藏 0
点赞 0
评论 0
private static void check(Object x, Descriptor d, Descriptor expect) {
String fail = null;
try {
Descriptor u = ImmutableDescriptor.union(d, expect);
if (!u.equals(d))
fail = "should contain " + expect + "; is " + d;
} catch (IllegalArgumentException e) {
fail = e.getMessage();
}
if (fail == null) {
System.out.println("OK: " + x);
} else {
failed = "NOT OK: Incorrect descriptor for: " + x;
System.out.println(failed);
System.out.println("..." + fail);
}
}
OpenMBeanAttributeInfoSupport.java 文件源码
项目:openjdk-source-code-learn
阅读 38
收藏 0
点赞 0
评论 0
static <T> Descriptor makeDescriptor(OpenType<T> openType,
T defaultValue,
T[] legalValues,
Comparable<T> minValue,
Comparable<T> maxValue) {
Map<String, Object> map = new HashMap<String, Object>();
if (defaultValue != null)
map.put("defaultValue", defaultValue);
if (legalValues != null) {
Set<T> set = new HashSet<T>();
for (T v : legalValues)
set.add(v);
set = Collections.unmodifiableSet(set);
map.put("legalValues", set);
}
if (minValue != null)
map.put("minValue", minValue);
if (maxValue != null)
map.put("maxValue", maxValue);
if (map.isEmpty()) {
return openType.getDescriptor();
} else {
map.put("openType", openType);
return new ImmutableDescriptor(map);
}
}
AnnotationTest.java 文件源码
项目:openjdk-source-code-learn
阅读 33
收藏 0
点赞 0
评论 0
private static void check(Object x, Descriptor d, Descriptor expect) {
String fail = null;
try {
Descriptor u = ImmutableDescriptor.union(d, expect);
if (!u.equals(d))
fail = "should contain " + expect + "; is " + d;
} catch (IllegalArgumentException e) {
fail = e.getMessage();
}
if (fail == null) {
System.out.println("OK: " + x);
} else {
failed = "NOT OK: Incorrect descriptor for: " + x;
System.out.println(failed);
System.out.println("..." + fail);
}
}
OpenMBeanAttributeInfoSupport.java 文件源码
项目:OLD-OpenJDK8
阅读 28
收藏 0
点赞 0
评论 0
static <T> Descriptor makeDescriptor(OpenType<T> openType,
T defaultValue,
T[] legalValues,
Comparable<T> minValue,
Comparable<T> maxValue) {
Map<String, Object> map = new HashMap<String, Object>();
if (defaultValue != null)
map.put("defaultValue", defaultValue);
if (legalValues != null) {
Set<T> set = new HashSet<T>();
for (T v : legalValues)
set.add(v);
set = Collections.unmodifiableSet(set);
map.put("legalValues", set);
}
if (minValue != null)
map.put("minValue", minValue);
if (maxValue != null)
map.put("maxValue", maxValue);
if (map.isEmpty()) {
return openType.getDescriptor();
} else {
map.put("openType", openType);
return new ImmutableDescriptor(map);
}
}
AnnotationTest.java 文件源码
项目:OLD-OpenJDK8
阅读 38
收藏 0
点赞 0
评论 0
private static void check(Object x, Descriptor d, Descriptor expect) {
String fail = null;
try {
Descriptor u = ImmutableDescriptor.union(d, expect);
if (!u.equals(d))
fail = "should contain " + expect + "; is " + d;
} catch (IllegalArgumentException e) {
fail = e.getMessage();
}
if (fail == null) {
System.out.println("OK: " + x);
} else {
failed = "NOT OK: Incorrect descriptor for: " + x;
System.out.println(failed);
System.out.println("..." + fail);
}
}
AnnotationTest.java 文件源码
项目:JAVA_UNIT
阅读 29
收藏 0
点赞 0
评论 0
private static void check(Object x, Descriptor d, Descriptor expect) {
String fail = null;
try {
Descriptor u = ImmutableDescriptor.union(d, expect);
if (!u.equals(d))
fail = "should contain " + expect + "; is " + d;
} catch (IllegalArgumentException e) {
fail = e.getMessage();
}
if (fail == null) {
System.out.println("OK: " + x);
} else {
failed = "NOT OK: Incorrect descriptor for: " + x;
System.out.println(failed);
System.out.println("..." + fail);
}
}
OpenMBeanAttributeInfoSupport.java 文件源码
项目:openjdk-jdk7u-jdk
阅读 36
收藏 0
点赞 0
评论 0
static <T> Descriptor makeDescriptor(OpenType<T> openType,
T defaultValue,
T[] legalValues,
Comparable<T> minValue,
Comparable<T> maxValue) {
Map<String, Object> map = new HashMap<String, Object>();
if (defaultValue != null)
map.put("defaultValue", defaultValue);
if (legalValues != null) {
Set<T> set = new HashSet<T>();
for (T v : legalValues)
set.add(v);
set = Collections.unmodifiableSet(set);
map.put("legalValues", set);
}
if (minValue != null)
map.put("minValue", minValue);
if (maxValue != null)
map.put("maxValue", maxValue);
if (map.isEmpty()) {
return openType.getDescriptor();
} else {
map.put("openType", openType);
return new ImmutableDescriptor(map);
}
}
AnnotationTest.java 文件源码
项目:openjdk-jdk7u-jdk
阅读 30
收藏 0
点赞 0
评论 0
private static void check(Object x, Descriptor d, Descriptor expect) {
String fail = null;
try {
Descriptor u = ImmutableDescriptor.union(d, expect);
if (!u.equals(d))
fail = "should contain " + expect + "; is " + d;
} catch (IllegalArgumentException e) {
fail = e.getMessage();
}
if (fail == null) {
System.out.println("OK: " + x);
} else {
failed = "NOT OK: Incorrect descriptor for: " + x;
System.out.println(failed);
System.out.println("..." + fail);
}
}
OpenMBeanAttributeInfoSupport.java 文件源码
项目:openjdk-icedtea7
阅读 25
收藏 0
点赞 0
评论 0
static <T> Descriptor makeDescriptor(OpenType<T> openType,
T defaultValue,
T[] legalValues,
Comparable<T> minValue,
Comparable<T> maxValue) {
Map<String, Object> map = new HashMap<String, Object>();
if (defaultValue != null)
map.put("defaultValue", defaultValue);
if (legalValues != null) {
Set<T> set = new HashSet<T>();
for (T v : legalValues)
set.add(v);
set = Collections.unmodifiableSet(set);
map.put("legalValues", set);
}
if (minValue != null)
map.put("minValue", minValue);
if (maxValue != null)
map.put("maxValue", maxValue);
if (map.isEmpty()) {
return openType.getDescriptor();
} else {
map.put("openType", openType);
return new ImmutableDescriptor(map);
}
}
AnnotationTest.java 文件源码
项目:openjdk-icedtea7
阅读 30
收藏 0
点赞 0
评论 0
private static void check(Object x, Descriptor d, Descriptor expect) {
String fail = null;
try {
Descriptor u = ImmutableDescriptor.union(d, expect);
if (!u.equals(d))
fail = "should contain " + expect + "; is " + d;
} catch (IllegalArgumentException e) {
fail = e.getMessage();
}
if (fail == null) {
System.out.println("OK: " + x);
} else {
failed = "NOT OK: Incorrect descriptor for: " + x;
System.out.println(failed);
System.out.println("..." + fail);
}
}
StandardMBeanIntrospector.java 文件源码
项目:OpenJSharp
阅读 25
收藏 0
点赞 0
评论 0
@Override
Descriptor getBasicMBeanDescriptor() {
/* We don't bother saying mxbean=false, and we can't know whether
the info is immutable until we know whether the MBean class
(not interface) is a NotificationBroadcaster. */
return ImmutableDescriptor.EMPTY_DESCRIPTOR;
}
MXBeanIntrospector.java 文件源码
项目:OpenJSharp
阅读 33
收藏 0
点赞 0
评论 0
@Override
Descriptor getMBeanDescriptor(Class<?> resourceClass) {
/* We already have immutableInfo=true in the Descriptor
* included in the MBeanInfo for the MXBean interface. This
* method is being called for the MXBean *class* to add any
* new items beyond those in the interface Descriptor, which
* currently it does not.
*/
return ImmutableDescriptor.EMPTY_DESCRIPTOR;
}
MXBeanIntrospector.java 文件源码
项目:OpenJSharp
阅读 28
收藏 0
点赞 0
评论 0
private static Descriptor typeDescriptor(OpenType<?> openType,
Type originalType) {
return new ImmutableDescriptor(
new String[] {"openType",
"originalType"},
new Object[] {openType,
originalTypeString(originalType)});
}