本文整理汇总了Java中java.lang.reflect.MalformedParametersException类的典型用法代码示例。如果您正苦于以下问题:Java MalformedParametersException类的具体用法?Java MalformedParametersException怎么用?Java MalformedParametersException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MalformedParametersException类属于java.lang.reflect包,在下文中一共展示了MalformedParametersException类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import java.lang.reflect.MalformedParametersException; //导入依赖的package包/类
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();
}
示例2: createFromSvg
import java.lang.reflect.MalformedParametersException; //导入依赖的package包/类
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;
}
示例3: createFromSvg
import java.lang.reflect.MalformedParametersException; //导入依赖的package包/类
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;
}
示例4: createFromSvg
import java.lang.reflect.MalformedParametersException; //导入依赖的package包/类
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;
}
示例5: createFromSvg
import java.lang.reflect.MalformedParametersException; //导入依赖的package包/类
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;
}
示例6: assertBadParameters
import java.lang.reflect.MalformedParametersException; //导入依赖的package包/类
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");
}
}
示例7: findParameterName
import java.lang.reflect.MalformedParametersException; //导入依赖的package包/类
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;
}