Skip to content

Commit 1105c93

Browse files
committed
Merge branch 'master' of https://github.com/mikkoz/msgpack-java
2 parents 7401974 + 1c90e16 commit 1105c93

27 files changed

+5803
-5
lines changed

NOTICE

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
This project uses code from the ASF Apache Harmony project. The following are the relevant notices
2+
from that project, included in order to comply with its license requirements.
3+
-------------------
4+
Apache Harmony
5+
Copyright 2006, 2010 The Apache Software Foundation.
6+
7+
This product includes software developed at
8+
The Apache Software Foundation (http://www.apache.org/).
9+
10+
Portions of Apache Harmony were originally developed by
11+
Intel Corporation and are licensed to the Apache Software
12+
Foundation under the "Software Grant and Corporate Contribution
13+
License Agreement" and for which the following copyright notices
14+
apply
15+
(C) Copyright 2005 Intel Corporation
16+
(C) Copyright 2005-2006 Intel Corporation
17+
(C) Copyright 2006 Intel Corporation
18+
19+
Portions of Apache Harmony's Class Library TEXT module contain JavaDoc
20+
derived from the ICU project.
21+
Copyright (c) 1995-2008 International Business Machines Corporation and others
22+
23+
24+
The Apache Harmony Development Kit (HDK) contains a jar file from the
25+
Apache Derby Project for which the following notice applies:
26+
27+
Apache Derby
28+
Copyright 2004-2007 The Apache Software Foundation
29+
30+
This product includes software developed by
31+
The Apache Software Foundation (http://www.apache.org/).
32+
33+
Portions of Derby were originally developed by
34+
International Business Machines Corporation and are
35+
licensed to the Apache Software Foundation under the
36+
"Software Grant and Corporate Contribution License Agreement",
37+
informally known as the "Derby CLA".
38+
The following copyright notice(s) were affixed to portions of the code
39+
with which this file is now or was at one time distributed
40+
and are placed here unaltered.
41+
42+
(C) Copyright 1997,2004 International Business Machines Corporation.
43+
All rights reserved.
44+
45+
(C) Copyright IBM Corp. 2003.
46+
47+
The portion of the functionTests under 'nist' was originally
48+
developed by the National Institute of Standards and Technology (NIST),
49+
an agency of the United States Department of Commerce, and adapted by
50+
International Business Machines Corporation in accordance with the NIST
51+
Software Acknowledgment and Redistribution document at
52+
http://www.itl.nist.gov/div897/ctg/sql_form.htm
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
// MODIFIED FOR THE MSGPACK PROJECT
2+
// Licensed to the Apache Software Foundation (ASF) under one or more
3+
// contributor license agreements. See the NOTICE file distributed with
4+
// this work for additional information regarding copyright ownership.
5+
// The ASF licenses this file to You under the Apache License, Version 2.0
6+
// (the "License"); you may not use this file except in compliance with
7+
// the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
// License for the specific language governing permissions and limitations under
15+
// the License.
16+
//
17+
18+
package custom.beans;
19+
20+
21+
/**
22+
* Describes a bean's global information.
23+
*/
24+
public class BeanDescriptor extends FeatureDescriptor {
25+
26+
private Class<?> beanClass;
27+
28+
private Class<?> customizerClass;
29+
30+
/**
31+
* <p>
32+
* Constructs an instance with the bean's {@link Class} and a customizer
33+
* {@link Class}. The descriptor's {@link #getName()} is set as the
34+
* unqualified name of the <code>beanClass</code>.
35+
* </p>
36+
*
37+
* @param beanClass
38+
* The bean's Class.
39+
* @param customizerClass
40+
* The bean's customizer Class.
41+
*/
42+
public BeanDescriptor(Class<?> beanClass, Class<?> customizerClass) {
43+
if (beanClass == null) {
44+
throw new NullPointerException();
45+
}
46+
setName(getShortClassName(beanClass));
47+
this.beanClass = beanClass;
48+
this.customizerClass = customizerClass;
49+
}
50+
51+
/**
52+
* <p>
53+
* Constructs an instance with the bean's {@link Class}. The descriptor's
54+
* {@link #getName()} is set as the unqualified name of the
55+
* <code>beanClass</code>.
56+
* </p>
57+
*
58+
* @param beanClass
59+
* The bean's Class.
60+
*/
61+
public BeanDescriptor(Class<?> beanClass) {
62+
this(beanClass, null);
63+
}
64+
65+
/**
66+
* <p>
67+
* Gets the bean's customizer {@link Class}/
68+
* </p>
69+
*
70+
* @return A {@link Class} instance or <code>null</code>.
71+
*/
72+
public Class<?> getCustomizerClass() {
73+
return customizerClass;
74+
}
75+
76+
/**
77+
* <p>
78+
* Gets the bean's {@link Class}.
79+
* </p>
80+
*
81+
* @return A {@link Class} instance.
82+
*/
83+
public Class<?> getBeanClass() {
84+
return beanClass;
85+
}
86+
87+
/**
88+
* <p>
89+
* Utility method for getting the unqualified name of a {@link Class}.
90+
* </p>
91+
*
92+
* @param leguminaClass
93+
* The Class to get the name from.
94+
* @return A String instance or <code>null</code>.
95+
*/
96+
private String getShortClassName(Class<?> leguminaClass) {
97+
if(leguminaClass == null) {
98+
return null;
99+
}
100+
String beanClassName = leguminaClass.getName();
101+
int lastIndex = beanClassName.lastIndexOf("."); //$NON-NLS-1$
102+
return (lastIndex == -1) ? beanClassName : beanClassName.substring(lastIndex + 1);
103+
}
104+
105+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// MODIFIED FOR THE MSGPACK PROJECT
2+
// Licensed to the Apache Software Foundation (ASF) under one or more
3+
// contributor license agreements. See the NOTICE file distributed with
4+
// this work for additional information regarding copyright ownership.
5+
// The ASF licenses this file to You under the Apache License, Version 2.0
6+
// (the "License"); you may not use this file except in compliance with
7+
// the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
// License for the specific language governing permissions and limitations under
15+
// the License.
16+
//
17+
18+
package custom.beans;
19+
20+
21+
public interface BeanInfo {
22+
23+
public PropertyDescriptor[] getPropertyDescriptors();
24+
25+
public MethodDescriptor[] getMethodDescriptors();
26+
27+
public EventSetDescriptor[] getEventSetDescriptors();
28+
29+
public BeanInfo[] getAdditionalBeanInfo();
30+
31+
public BeanDescriptor getBeanDescriptor();
32+
33+
public int getDefaultPropertyIndex();
34+
35+
public int getDefaultEventIndex();
36+
}

0 commit comments

Comments
 (0)