| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | public static class Builder extends |
| | | AbstractBuilder<String, ClassPropertyDefinition> { |
| | | |
| | | // List of interfaces which property values must implement. |
| | | /** List of interfaces which property values must implement. */ |
| | | private List<String> instanceOfInterfaces; |
| | | |
| | | |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName) { |
| | | super(d, propertyName); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected ClassPropertyDefinition buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, |
| | |
| | | |
| | | } |
| | | |
| | | // Regular expression for validating class names. |
| | | /** Regular expression for validating class names. */ |
| | | private static final String CLASS_RE = |
| | | "^([A-Za-z][A-Za-z0-9_]*\\.)*[A-Za-z][A-Za-z0-9_]*(\\$[A-Za-z0-9_]+)*$"; |
| | | |
| | | /* |
| | | /** |
| | | * Flag indicating whether class property values should be validated. |
| | | */ |
| | | private static boolean allowClassValidation = true; |
| | |
| | | |
| | | |
| | | |
| | | // Load a named class. |
| | | /** Load a named class. */ |
| | | private static Class<?> loadClass(String className, boolean initialize) |
| | | throws ClassNotFoundException, LinkageError { |
| | | return Class.forName(className, initialize, ClassLoaderProvider |
| | | .getInstance().getClassLoader()); |
| | | } |
| | | |
| | | // List of interfaces which property values must implement. |
| | | /** List of interfaces which property values must implement. */ |
| | | private final List<String> instanceOfInterfaces; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private ClassPropertyDefinition( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitClass(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, String value, P p) { |
| | | return v.visitClass(this, value, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String decodeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String normalizeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /* |
| | | /** |
| | | * Make sure that named class implements the interfaces named by this |
| | | * definition. |
| | | */ |
| | |
| | | |
| | | |
| | | |
| | | /* |
| | | /** |
| | | * Do some basic checks to make sure the string representation is valid. |
| | | */ |
| | | private void validateClassName(String className) |