当前位置: 首页>>代码示例>>Java>>正文


Java MalformedParametersException类代码示例

本文整理汇总了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();
}
 
开发者ID:SoftGorilla,项目名称:restheart-java-client,代码行数:20,代码来源:MongoURLBuilder.java

示例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;
}
 
开发者ID:pfolta,项目名称:Shapify,代码行数:27,代码来源:Ellipse.java

示例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;
}
 
开发者ID:pfolta,项目名称:Shapify,代码行数:25,代码来源:Line.java

示例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;
}
 
开发者ID:pfolta,项目名称:Shapify,代码行数:24,代码来源:Image.java

示例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;
}
 
开发者ID:pfolta,项目名称:Shapify,代码行数:27,代码来源:Rectangle.java

示例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");
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:BadClassFiles.java

示例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;
    }
 
开发者ID:FasterXML,项目名称:jackson-modules-java8,代码行数:13,代码来源:ParameterNamesAnnotationIntrospector.java


注:本文中的java.lang.reflect.MalformedParametersException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。