本文整理匯總了Java中java.beans.ConstructorProperties類的典型用法代碼示例。如果您正苦於以下問題:Java ConstructorProperties類的具體用法?Java ConstructorProperties怎麽用?Java ConstructorProperties使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ConstructorProperties類屬於java.beans包,在下文中一共展示了ConstructorProperties類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: OSMetrics
import java.beans.ConstructorProperties; //導入依賴的package包/類
/**
*
* This constructor is to be used by internal JMX framework only. User should not try to create an
* instance of this class.
*/
@ConstructorProperties({"maxFileDescriptorCount", "openFileDescriptorCount", "processCpuTime",
"committedVirtualMemorySize", "totalPhysicalMemorySize", "freePhysicalMemorySize",
"totalSwapSpaceSize", "freeSwapSpaceSize", "name", "version", "arch", "availableProcessors",
"systemLoadAverage"
})
public OSMetrics(long maxFileDescriptorCount, long openFileDescriptorCount, long processCpuTime,
long committedVirtualMemorySize, long totalPhysicalMemorySize, long freePhysicalMemorySize,
long totalSwapSpaceSize, long freeSwapSpaceSize, String name, String version, String arch,
int availableProcessors, double systemLoadAverage) {
this.maxFileDescriptorCount = maxFileDescriptorCount;
this.openFileDescriptorCount = openFileDescriptorCount;
this.processCpuTime = processCpuTime;
this.committedVirtualMemorySize = committedVirtualMemorySize;
this.totalPhysicalMemorySize = totalPhysicalMemorySize;
this.freePhysicalMemorySize = freePhysicalMemorySize;
this.totalSwapSpaceSize = totalSwapSpaceSize;
this.freeSwapSpaceSize = freeSwapSpaceSize;
this.name = name;
this.version = version;
this.arch = arch;
this.availableProcessors = availableProcessors;
this.systemLoadAverage = systemLoadAverage;
}
示例2: TitledBorder
import java.beans.ConstructorProperties; //導入依賴的package包/類
/**
* Creates a TitledBorder instance with the specified border,
* title, title-justification, title-position, title-font, and
* title-color.
*
* @param border the border
* @param title the title the border should display
* @param titleJustification the justification for the title
* @param titlePosition the position for the title
* @param titleFont the font of the title
* @param titleColor the color of the title
*/
@ConstructorProperties({"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"})
public TitledBorder(Border border,
String title,
int titleJustification,
int titlePosition,
Font titleFont,
Color titleColor) {
this.title = title;
this.border = border;
this.titleFont = titleFont;
this.titleColor = titleColor;
setTitleJustification(titleJustification);
setTitlePosition(titlePosition);
this.label = new JLabel();
this.label.setOpaque(false);
this.label.putClientProperty(BasicHTML.propertyKey, null);
installPropertyChangeListeners();
}
示例3: DefaultCellEditor
import java.beans.ConstructorProperties; //導入依賴的package包/類
/**
* Constructs a <code>DefaultCellEditor</code> that uses a text field.
*
* @param textField a <code>JTextField</code> object
*/
@ConstructorProperties({"component"})
public DefaultCellEditor(final JTextField textField) {
editorComponent = textField;
this.clickCountToStart = 2;
delegate = new EditorDelegate() {
public void setValue(Object value) {
textField.setText((value != null) ? value.toString() : "");
}
public Object getCellEditorValue() {
return textField.getText();
}
};
textField.addActionListener(delegate);
}
示例4: TitledBorder
import java.beans.ConstructorProperties; //導入依賴的package包/類
/**
* Creates a TitledBorder instance with the specified border,
* title, title-justification, title-position, title-font, and
* title-color.
*
* @param border the border
* @param title the title the border should display
* @param titleJustification the justification for the title
* @param titlePosition the position for the title
* @param titleFont the font of the title
* @param titleColor the color of the title
*/
@ConstructorProperties({"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"})
public TitledBorder(Border border,
String title,
int titleJustification,
int titlePosition,
Font titleFont,
Color titleColor) {
this.title = title;
this.border = border;
this.titleFont = titleFont;
this.titleColor = titleColor;
setTitleJustification(titleJustification);
setTitlePosition(titlePosition);
this.label = new JLabel();
this.label.setOpaque(false);
this.label.putClientProperty(BasicHTML.propertyKey, null);
}
示例5: ScrollPane
import java.beans.ConstructorProperties; //導入依賴的package包/類
/**
* Create a new scrollpane container.
* @param scrollbarDisplayPolicy policy for when scrollbars should be shown
* @throws IllegalArgumentException if the specified scrollbar
* display policy is invalid
* @throws HeadlessException if GraphicsEnvironment.isHeadless()
* returns true
* @see java.awt.GraphicsEnvironment#isHeadless
*/
@ConstructorProperties({"scrollbarDisplayPolicy"})
public ScrollPane(int scrollbarDisplayPolicy) throws HeadlessException {
GraphicsEnvironment.checkHeadless();
this.layoutMgr = null;
this.width = 100;
this.height = 100;
switch (scrollbarDisplayPolicy) {
case SCROLLBARS_NEVER:
case SCROLLBARS_AS_NEEDED:
case SCROLLBARS_ALWAYS:
this.scrollbarDisplayPolicy = scrollbarDisplayPolicy;
break;
default:
throw new IllegalArgumentException("illegal scrollbar display policy");
}
vAdjustable = new ScrollPaneAdjustable(this, new PeerFixer(this),
Adjustable.VERTICAL);
hAdjustable = new ScrollPaneAdjustable(this, new PeerFixer(this),
Adjustable.HORIZONTAL);
setWheelScrollingEnabled(defaultWheelScroll);
}
示例6: ThreadExecutorStats
import java.beans.ConstructorProperties; //導入依賴的package包/類
@ConstructorProperties({"activeThreadCount","currentThreadPoolSize","largestThreadPoolSize",
"maxThreadPoolSize","currentQueueSize","largestQueueSize","maxQueueSize",
"completedTaskCount","totalTaskCount","rejectedTaskCount"})
public ThreadExecutorStats(long activeThreadCount, long currentThreadPoolSize,
long largestThreadPoolSize, long maxThreadPoolSize, long currentQueueSize,
Long largestQueueSize, long maxQueueSize, long completedTaskCount,
long totalTaskCount, Long rejectedTaskCount) {
this.activeThreadCount = activeThreadCount;
this.currentThreadPoolSize = currentThreadPoolSize;
this.largestQueueSize = largestQueueSize;
this.largestThreadPoolSize = largestThreadPoolSize;
this.maxThreadPoolSize = maxThreadPoolSize;
this.currentQueueSize = currentQueueSize;
this.maxQueueSize = maxQueueSize;
this.completedTaskCount = completedTaskCount;
this.totalTaskCount = totalTaskCount;
this.rejectedTaskCount = rejectedTaskCount;
}
示例7: PluginDescription
import java.beans.ConstructorProperties; //導入依賴的package包/類
@ConstructorProperties({"file", "name", "author", "version", "description", "website"})
public PluginDescription(File file, String name, List<String> author, String version, String description, String website) {
this.file = file;
this.name = name;
this.author = author;
this.version = version;
this.description = description;
this.website = website;
}
示例8: StatisticInformation
import java.beans.ConstructorProperties; //導入依賴的package包/類
@ConstructorProperties ( { "label", "current", "minimum", "maximum" } )
public StatisticInformation ( final String label, final Double current, final Double minimum, final Double maximum )
{
super ();
this.label = label;
this.current = current;
this.minimum = minimum;
this.maximum = maximum;
}
示例9: evaluate
import java.beans.ConstructorProperties; //導入依賴的package包/類
public static String[] evaluate(Constructor<?> candidate, int paramCount) {
ConstructorProperties cp = candidate.getAnnotation(ConstructorProperties.class);
if (cp != null) {
String[] names = cp.value();
if (names.length != paramCount) {
throw new IllegalStateException("Constructor annotated with @ConstructorProperties but not " +
"corresponding to actual number of parameters (" + paramCount + "): " + candidate);
}
return names;
}
else {
return null;
}
}
示例10: Cursor
import java.beans.ConstructorProperties; //導入依賴的package包/類
/**
* Creates a new cursor object with the specified type.
* @param type the type of cursor
* @throws IllegalArgumentException if the specified cursor type
* is invalid
*/
@ConstructorProperties({"type"})
public Cursor(int type) {
if (type < Cursor.DEFAULT_CURSOR || type > Cursor.MOVE_CURSOR) {
throw new IllegalArgumentException("illegal cursor type");
}
this.type = type;
// Lookup localized name.
name = Toolkit.getProperty(cursorProperties[type][0],
cursorProperties[type][1]);
}
示例11: EmptyBorder
import java.beans.ConstructorProperties; //導入依賴的package包/類
/**
* Creates an empty border with the specified insets.
* @param borderInsets the insets of the border
*/
@ConstructorProperties({"borderInsets"})
public EmptyBorder(Insets borderInsets) {
this.top = borderInsets.top;
this.right = borderInsets.right;
this.bottom = borderInsets.bottom;
this.left = borderInsets.left;
}
示例12: BevelBorder
import java.beans.ConstructorProperties; //導入依賴的package包/類
/**
* Creates a bevel border with the specified type, highlight and
* shadow colors.
*
* @param bevelType the type of bevel for the border
* @param highlightOuterColor the color to use for the bevel outer highlight
* @param highlightInnerColor the color to use for the bevel inner highlight
* @param shadowOuterColor the color to use for the bevel outer shadow
* @param shadowInnerColor the color to use for the bevel inner shadow
*/
@ConstructorProperties({"bevelType", "highlightOuterColor", "highlightInnerColor", "shadowOuterColor", "shadowInnerColor"})
public BevelBorder(int bevelType, Color highlightOuterColor,
Color highlightInnerColor, Color shadowOuterColor,
Color shadowInnerColor) {
this(bevelType);
this.highlightOuter = highlightOuterColor;
this.highlightInner = highlightInnerColor;
this.shadowOuter = shadowOuterColor;
this.shadowInner = shadowInnerColor;
}
示例13: DataTreeListenerInfo
import java.beans.ConstructorProperties; //導入依賴的package包/類
@ConstructorProperties({"listener","registeredPath", "isEnabled", "notificationCount"})
public DataTreeListenerInfo(final String listener, final String registeredPath, final boolean isEnabled,
final long notificationCount) {
this.listener = Preconditions.checkNotNull(listener);
this.registeredPath = Preconditions.checkNotNull(registeredPath);
this.isEnabled = isEnabled;
this.notificationCount = notificationCount;
}
示例14: processPropertyType
import java.beans.ConstructorProperties; //導入依賴的package包/類
/**
* Finds the appropriate constructor for the specified type that we will use to construct
* instances.
*/
private static void processPropertyType(final Class<?> propertyType)
throws NoSuchMethodException, SecurityException, IntrospectionException {
final Class<?> wrappedType = Primitives.wrap(propertyType);
if (CONSTRUCTORS.containsKey(wrappedType)) {
return;
}
// If the type is a primitive (or String type), we look for the constructor that takes a
// single String argument, which, for primitives, validates and converts from a String
// representation which is the form we get on ingress.
if (propertyType.isPrimitive() || Primitives.isWrapperType(propertyType) || propertyType.equals(String.class)) {
CONSTRUCTORS.put(wrappedType, propertyType.getConstructor(String.class));
} else {
// This must be a yang-defined type. We need to find the constructor that takes a
// primitive as the only argument. This will be used to construct instances to perform
// validation (eg range checking). The yang-generated types have a couple single-argument
// constructors but the one we want has the bean ConstructorProperties annotation.
for (final Constructor<?> ctor: propertyType.getConstructors()) {
final ConstructorProperties ctorPropsAnnotation = ctor.getAnnotation(ConstructorProperties.class);
if (ctor.getParameterTypes().length == 1 && ctorPropsAnnotation != null) {
findYangTypeGetter(propertyType, ctorPropsAnnotation.value()[0]);
CONSTRUCTORS.put(propertyType, ctor);
break;
}
}
}
}
示例15: TitledBorderUIResource
import java.beans.ConstructorProperties; //導入依賴的package包/類
@ConstructorProperties({"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"})
public TitledBorderUIResource(Border border,
String title,
int titleJustification,
int titlePosition,
Font titleFont,
Color titleColor) {
super(border, title, titleJustification, titlePosition, titleFont, titleColor);
}