Skip to content

Commit

Permalink
Merge branch 'UsageEntryPoint' into 'master'
Browse files Browse the repository at this point in the history
UsageEntryPoint added

See merge request exedio/copeconsole!125
  • Loading branch information
rw7 committed Jan 20, 2025
2 parents 4f0ad78 + a5e12e3 commit b00df00
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 9 deletions.
6 changes: 4 additions & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/com/exedio/cope/console/ConsoleServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ protected boolean isStable(final FeatureField<?> featureField)
static final Resource checkTrue = new Resource("checktrue.png");

static final Resource nodeFalse = new Resource("nodefalse.png");
@SuppressWarnings("unused") // OK: url set by javascript
@UsageEntryPoint // OK: url set by javascript
static final Resource nodeTrue = new Resource("nodetrue.png");

private static final Resource nodeWarningFalse = new Resource("nodewarningfalse.png");
@SuppressWarnings("unused") // OK: url set by javascript
@UsageEntryPoint // OK: url set by javascript
static final Resource nodeWarningTrue = new Resource("nodewarningtrue.png");

private static final Resource nodeErrorFalse = new Resource("nodeerrorfalse.png");
@SuppressWarnings("unused") // OK: url set by javascript
@UsageEntryPoint // OK: url set by javascript
static final Resource nodeErrorTrue = new Resource("nodeerrortrue.png");

static Resource nodeFalse(final Node.Color color)
Expand Down
35 changes: 35 additions & 0 deletions src/com/exedio/cope/console/UsageEntryPoint.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2004-2009 exedio GmbH (www.exedio.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

package com.exedio.cope.console;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({TYPE, FIELD, METHOD})
@Retention(RetentionPolicy.SOURCE)
// TODO replace with @UsageEntryPoint in copeutil instead when available
@interface UsageEntryPoint
{
// no parameters
}
2 changes: 1 addition & 1 deletion websrc/com/exedio/cope/console/example/ANameServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public final class ANameServer extends MediaPath

final StringField source;

@SuppressWarnings("unused") // OK: used by reflection
@UsageEntryPoint // OK: used by reflection
ANameServer(final StringField source)
{
this.source = source;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class HashConstraintItem extends Item
{
static final StringField hash = new StringField();
static final DataField data = new DataField();
@SuppressWarnings("unused")
@UsageEntryPoint
static final HashConstraint constraint = new HashConstraint(hash, () -> "MD5", data);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class HashConstraintItemUnsupported extends Item
{
static final StringField hash = new StringField();
static final DataField data = new DataField();
@SuppressWarnings("unused")
@UsageEntryPoint
static final HashConstraint constraint = new HashConstraint(hash, () -> "MD2", data);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ final class StringLengthItem extends Item
* {@code CharacterNulCop} with copeutil before revision 863.
*/
@WrapperIgnore
@SuppressWarnings("unused")
@UsageEntryPoint
static final StringField charSet = new StringField().optional().charSet(CharSet.EMAIL_INTERNATIONAL);


Expand Down
36 changes: 36 additions & 0 deletions websrc/com/exedio/cope/console/example/UsageEntryPoint.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (C) 2004-2009 exedio GmbH (www.exedio.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

package com.exedio.cope.console.example;

import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({TYPE, FIELD, METHOD, CONSTRUCTOR})
@Retention(RetentionPolicy.SOURCE)
// TODO replace with @UsageEntryPoint in copeutil instead when available
@interface UsageEntryPoint
{
// no parameters
}

0 comments on commit b00df00

Please sign in to comment.