Java 类java.lang.reflect.MalformedParametersException 实例源码
项目:restheart-java-client
文件:MongoURLBuilder.java
public String build() throws MalformedParametersException {
if(this.baseURL == null || this.baseURL.isEmpty()) {
throw new MalformedParametersException("Cannot build URL with empty host");
}
StringBuilder sb = new StringBuilder();
sb.append(this.baseURL);
if(databaseName != null && !databaseName.isEmpty()) {
sb.append("/").append(databaseName);
if(collectionName != null && !collectionName.isEmpty()) {
sb.append("/").append(collectionName);
if(documentId != null && !documentId.isEmpty()) {
sb.append("/").append(documentId);
}
}
}
return sb.toString();
}
项目:Shapify
文件:Ellipse.java
public static Ellipse createFromSvg(Element element) throws MalformedParametersException {
if (!element.getName().toLowerCase().trim().equals("ellipse")) {
throw new MalformedParametersException("SVG Element is not an Ellipse.");
}
Ellipse ellipse = new Ellipse();
ellipse.setCenterX(Double.parseDouble(element.getAttributeValue("cx")));
ellipse.setCenterY(Double.parseDouble(element.getAttributeValue("cy")));
ellipse.setRadiusX(Double.parseDouble(element.getAttributeValue("rx")));
ellipse.setRadiusY(Double.parseDouble(element.getAttributeValue("ry")));
ellipse.setFill(Color.web(element.getAttributeValue("fill"), Double.parseDouble(element.getAttributeValue("fill-opacity"))));
ellipse.setStroke(Color.web(element.getAttributeValue("stroke"), Double.parseDouble(element.getAttributeValue("stroke-opacity"))));
ellipse.setStrokeWidth(Double.parseDouble(element.getAttributeValue("stroke-width")));
String svgTransforms = element.getAttributeValue("transform");
if (svgTransforms != null) {
List<Transform> transforms = ShapeUtils.getTransformsFromSvg(svgTransforms);
ellipse.getTransforms().addAll(transforms);
}
return ellipse;
}
项目:Shapify
文件:Line.java
public static Line createFromSvg(Element element) throws MalformedParametersException {
if (!element.getName().toLowerCase().trim().equals("line")) {
throw new MalformedParametersException("SVG Element is not a Line.");
}
Line line = new Line();
line.setStartX(Double.parseDouble(element.getAttributeValue("x1")));
line.setStartY(Double.parseDouble(element.getAttributeValue("y1")));
line.setEndX(Double.parseDouble(element.getAttributeValue("x2")));
line.setEndY(Double.parseDouble(element.getAttributeValue("y2")));
line.setStroke(Color.web(element.getAttributeValue("stroke"), Double.parseDouble(element.getAttributeValue("stroke-opacity"))));
line.setStrokeWidth(Double.parseDouble(element.getAttributeValue("stroke-width")));
String svgTransforms = element.getAttributeValue("transform");
if (svgTransforms != null) {
List<Transform> transforms = ShapeUtils.getTransformsFromSvg(svgTransforms);
line.getTransforms().addAll(transforms);
}
return line;
}
项目:Shapify
文件:Image.java
public static Image createFromSvg(Element element) throws MalformedParametersException {
if (!element.getName().toLowerCase().trim().equals("image")) {
throw new MalformedParametersException("SVG Element is not a Rectangle.");
}
Image image = new Image();
image.setImage(getImageFromBase64(element.getAttributeValue("href", SvgController.XLINK_NAMESPACE)));
image.setX(Double.parseDouble(element.getAttributeValue("x")));
image.setY(Double.parseDouble(element.getAttributeValue("y")));
image.setFitWidth(Double.parseDouble(element.getAttributeValue("width")));
image.setFitHeight(Double.parseDouble(element.getAttributeValue("height")));
String svgTransforms = element.getAttributeValue("transform");
if (svgTransforms != null) {
List<Transform> transforms = ShapeUtils.getTransformsFromSvg(svgTransforms);
image.getTransforms().addAll(transforms);
}
return image;
}
项目:Shapify
文件:Rectangle.java
public static Rectangle createFromSvg(Element element) throws MalformedParametersException {
if (!element.getName().toLowerCase().trim().equals("rect")) {
throw new MalformedParametersException("SVG Element is not a Rectangle.");
}
Rectangle rectangle = new Rectangle();
rectangle.setX(Double.parseDouble(element.getAttributeValue("x")));
rectangle.setY(Double.parseDouble(element.getAttributeValue("y")));
rectangle.setWidth(Double.parseDouble(element.getAttributeValue("width")));
rectangle.setHeight(Double.parseDouble(element.getAttributeValue("height")));
rectangle.setFill(Color.web(element.getAttributeValue("fill"), Double.parseDouble(element.getAttributeValue("fill-opacity"))));
rectangle.setStroke(Color.web(element.getAttributeValue("stroke"), Double.parseDouble(element.getAttributeValue("stroke-opacity"))));
rectangle.setStrokeWidth(Double.parseDouble(element.getAttributeValue("stroke-width")));
String svgTransforms = element.getAttributeValue("transform");
if (svgTransforms != null) {
List<Transform> transforms = ShapeUtils.getTransformsFromSvg(svgTransforms);
rectangle.getTransforms().addAll(transforms);
}
return rectangle;
}
项目:Shapify
文件:Ellipse.java
public static Ellipse createFromSvg(Element element) throws MalformedParametersException {
if (!element.getName().toLowerCase().trim().equals("ellipse")) {
throw new MalformedParametersException("SVG Element is not an Ellipse.");
}
Ellipse ellipse = new Ellipse();
ellipse.setCenterX(Double.parseDouble(element.getAttributeValue("cx")));
ellipse.setCenterY(Double.parseDouble(element.getAttributeValue("cy")));
ellipse.setRadiusX(Double.parseDouble(element.getAttributeValue("rx")));
ellipse.setRadiusY(Double.parseDouble(element.getAttributeValue("ry")));
ellipse.setFill(Color.web(element.getAttributeValue("fill"), Double.parseDouble(element.getAttributeValue("fill-opacity"))));
ellipse.setStroke(Color.web(element.getAttributeValue("stroke"), Double.parseDouble(element.getAttributeValue("stroke-opacity"))));
ellipse.setStrokeWidth(Double.parseDouble(element.getAttributeValue("stroke-width")));
String svgTransforms = element.getAttributeValue("transform");
if (svgTransforms != null) {
List<Transform> transforms = ShapeUtils.getTransformsFromSvg(svgTransforms);
ellipse.getTransforms().addAll(transforms);
}
return ellipse;
}
项目:Shapify
文件:Line.java
public static Line createFromSvg(Element element) throws MalformedParametersException {
if (!element.getName().toLowerCase().trim().equals("line")) {
throw new MalformedParametersException("SVG Element is not a Line.");
}
Line line = new Line();
line.setStartX(Double.parseDouble(element.getAttributeValue("x1")));
line.setStartY(Double.parseDouble(element.getAttributeValue("y1")));
line.setEndX(Double.parseDouble(element.getAttributeValue("x2")));
line.setEndY(Double.parseDouble(element.getAttributeValue("y2")));
line.setStroke(Color.web(element.getAttributeValue("stroke"), Double.parseDouble(element.getAttributeValue("stroke-opacity"))));
line.setStrokeWidth(Double.parseDouble(element.getAttributeValue("stroke-width")));
String svgTransforms = element.getAttributeValue("transform");
if (svgTransforms != null) {
List<Transform> transforms = ShapeUtils.getTransformsFromSvg(svgTransforms);
line.getTransforms().addAll(transforms);
}
return line;
}
项目:Shapify
文件:Image.java
public static Image createFromSvg(Element element) throws MalformedParametersException {
if (!element.getName().toLowerCase().trim().equals("image")) {
throw new MalformedParametersException("SVG Element is not a Rectangle.");
}
Image image = new Image();
image.setImage(getImageFromBase64(element.getAttributeValue("href", SvgController.XLINK_NAMESPACE)));
image.setX(Double.parseDouble(element.getAttributeValue("x")));
image.setY(Double.parseDouble(element.getAttributeValue("y")));
image.setFitWidth(Double.parseDouble(element.getAttributeValue("width")));
image.setFitHeight(Double.parseDouble(element.getAttributeValue("height")));
String svgTransforms = element.getAttributeValue("transform");
if (svgTransforms != null) {
List<Transform> transforms = ShapeUtils.getTransformsFromSvg(svgTransforms);
image.getTransforms().addAll(transforms);
}
return image;
}
项目:Shapify
文件:Rectangle.java
public static Rectangle createFromSvg(Element element) throws MalformedParametersException {
if (!element.getName().toLowerCase().trim().equals("rect")) {
throw new MalformedParametersException("SVG Element is not a Rectangle.");
}
Rectangle rectangle = new Rectangle();
rectangle.setX(Double.parseDouble(element.getAttributeValue("x")));
rectangle.setY(Double.parseDouble(element.getAttributeValue("y")));
rectangle.setWidth(Double.parseDouble(element.getAttributeValue("width")));
rectangle.setHeight(Double.parseDouble(element.getAttributeValue("height")));
rectangle.setFill(Color.web(element.getAttributeValue("fill"), Double.parseDouble(element.getAttributeValue("fill-opacity"))));
rectangle.setStroke(Color.web(element.getAttributeValue("stroke"), Double.parseDouble(element.getAttributeValue("stroke-opacity"))));
rectangle.setStrokeWidth(Double.parseDouble(element.getAttributeValue("stroke-width")));
String svgTransforms = element.getAttributeValue("transform");
if (svgTransforms != null) {
List<Transform> transforms = ShapeUtils.getTransformsFromSvg(svgTransforms);
rectangle.getTransforms().addAll(transforms);
}
return rectangle;
}
项目:jdk8u-jdk
文件:BadClassFiles.java
public void assertBadParameters(Class<?> cls) throws NoSuchMethodException {
try {
System.err.println("Trying " + cls);
final Method method = cls.getMethod("m", int.class, int.class);
final Parameter[] params = method.getParameters();
System.err.println("Name " + params[0].getName());
System.err.println("Did not see expected exception");
errors++;
} catch(MalformedParametersException e) {
System.err.println("Expected exception seen");
}
}
项目:openjdk-jdk10
文件:BadClassFiles.java
public void assertBadParameters(Class<?> cls) throws NoSuchMethodException {
try {
System.err.println("Trying " + cls);
final Method method = cls.getMethod("m", int.class, int.class);
final Parameter[] params = method.getParameters();
System.err.println("Name " + params[0].getName());
System.err.println("Did not see expected exception");
errors++;
} catch(MalformedParametersException e) {
System.err.println("Expected exception seen");
}
}
项目:openjdk9
文件:BadClassFiles.java
public void assertBadParameters(Class<?> cls) throws NoSuchMethodException {
try {
System.err.println("Trying " + cls);
final Method method = cls.getMethod("m", int.class, int.class);
final Parameter[] params = method.getParameters();
System.err.println("Name " + params[0].getName());
System.err.println("Did not see expected exception");
errors++;
} catch(MalformedParametersException e) {
System.err.println("Expected exception seen");
}
}
项目:jdk8u_jdk
文件:BadClassFiles.java
public void assertBadParameters(Class<?> cls) throws NoSuchMethodException {
try {
System.err.println("Trying " + cls);
final Method method = cls.getMethod("m", int.class, int.class);
final Parameter[] params = method.getParameters();
System.err.println("Name " + params[0].getName());
System.err.println("Did not see expected exception");
errors++;
} catch(MalformedParametersException e) {
System.err.println("Expected exception seen");
}
}
项目:lookaside_java-1.8.0-openjdk
文件:BadClassFiles.java
public void assertBadParameters(Class<?> cls) throws NoSuchMethodException {
try {
System.err.println("Trying " + cls);
final Method method = cls.getMethod("m", int.class, int.class);
final Parameter[] params = method.getParameters();
System.err.println("Name " + params[0].getName());
System.err.println("Did not see expected exception");
errors++;
} catch(MalformedParametersException e) {
System.err.println("Expected exception seen");
}
}
项目:jackson-modules-java8
文件:ParameterNamesAnnotationIntrospector.java
private String findParameterName(AnnotatedParameter annotatedParameter) {
Parameter[] params;
try {
params = getParameters(annotatedParameter.getOwner());
} catch (MalformedParametersException e) {
return null;
}
Parameter p = params[annotatedParameter.getIndex()];
return p.isNamePresent() ? p.getName() : null;
}
项目:infobip-open-jdk-8
文件:BadClassFiles.java
public void assertBadParameters(Class<?> cls) throws NoSuchMethodException {
try {
System.err.println("Trying " + cls);
final Method method = cls.getMethod("m", int.class, int.class);
final Parameter[] params = method.getParameters();
System.err.println("Name " + params[0].getName());
System.err.println("Did not see expected exception");
errors++;
} catch(MalformedParametersException e) {
System.err.println("Expected exception seen");
}
}
项目:jdk8u-dev-jdk
文件:BadClassFiles.java
public void assertBadParameters(Class<?> cls) throws NoSuchMethodException {
try {
System.err.println("Trying " + cls);
final Method method = cls.getMethod("m", int.class, int.class);
final Parameter[] params = method.getParameters();
System.err.println("Name " + params[0].getName());
System.err.println("Did not see expected exception");
errors++;
} catch(MalformedParametersException e) {
System.err.println("Expected exception seen");
}
}
项目:OLD-OpenJDK8
文件:BadClassFiles.java
public void assertBadParameters(Class<?> cls) throws NoSuchMethodException {
try {
System.err.println("Trying " + cls);
final Method method = cls.getMethod("m", int.class, int.class);
final Parameter[] params = method.getParameters();
System.err.println("Name " + params[0].getName());
System.err.println("Did not see expected exception");
errors++;
} catch(MalformedParametersException e) {
System.err.println("Expected exception seen");
}
}